Changeset 2307487
- Timestamp:
- 05/18/2020 09:38:00 PM (6 years ago)
- Location:
- bruce-clay-seo/trunk
- Files:
-
- 12 edited
-
css/admin-style.css (modified) (1 diff)
-
css/admin-style.scss (modified) (1 diff)
-
css/editor-style-min.css (modified) (1 diff)
-
css/editor-style.css (modified) (1 diff)
-
js/script.js (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
-
seotoolset.php (modified) (2 diffs)
-
src/SEOToolSet.php (modified) (5 diffs)
-
src/templates/ajax-dashboard-activity.php (modified) (2 diffs)
-
src/templates/ajax-dashboard-content.php (modified) (1 diff)
-
src/templates/ajax-post-meta-description.php (modified) (2 diffs)
-
src/templates/tabs.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
bruce-clay-seo/trunk/css/admin-style.css
r2240139 r2307487 1 1 /** 2 * seotoolset: v0.7. 02 * seotoolset: v0.7.1 3 3 */ 4 4 pre.seotoolset { -
bruce-clay-seo/trunk/css/admin-style.scss
r2240139 r2307487 1 1 /** 2 * seotoolset: v0.7. 02 * seotoolset: v0.7.1 3 3 */ 4 4 -
bruce-clay-seo/trunk/css/editor-style-min.css
r2240139 r2307487 1 1 /** 2 * seotoolset: v0.7. 02 * seotoolset: v0.7.1 3 3 */ 4 4 -
bruce-clay-seo/trunk/css/editor-style.css
r2240139 r2307487 1 1 /** 2 * seotoolset: v0.7. 02 * seotoolset: v0.7.1 3 3 */ 4 4 -
bruce-clay-seo/trunk/js/script.js
r2240139 r2307487 1 1 /** 2 * seotoolset: v0.7. 02 * seotoolset: v0.7.1 3 3 */ 4 4 … … 2062 2062 } 2063 2063 ); 2064 2065 2066 /** 2067 * Function to update Meta description 2068 */ 2069 function updateMetaDescription() { 2070 const metaTitle = $('.tab.meta-description #seotoolset_meta_title').val(); 2071 const metaDescription = $('.tab.meta-description #seotoolset_meta_description').val(); 2072 $('.tab.meta-description .seotoolset_meta_title_label').html(metaTitle); 2073 $('.tab.meta-description .seotoolset_meta_description_label').html(metaDescription); 2074 $.ajax({ 2075 url: seotoolset_vars.ajax_url, 2076 type: 'post', 2077 dataType: 'json', 2078 data: { 2079 action: 'saveMetaDescription', 2080 seotoolset_post_id: seotoolset_vars.post_id, 2081 seotoolset_meta_title: metaTitle, 2082 seotoolset_meta_description: metaDescription 2083 }, 2084 success: function(result) { 2085 let className = ''; 2086 if (result.status === 200) { 2087 className = ' met'; 2088 } 2089 let resultMessage = '<span class="pill"><span class="goal' + className + '">' + result.message + '</span></span>'; 2090 $('.seo-meta-messages').html(resultMessage); 2091 } 2092 }); 2093 } 2094 2095 2096 /** 2097 * Selector to call updateMetaDescription() function 2098 */ 2099 $('.tab.meta-description #seotoolset_meta_title, .tab.meta-description #seotoolset_meta_description').on('input', function() { 2100 updateMetaDescription(); 2101 }); 2064 2102 2065 2103 -
bruce-clay-seo/trunk/readme.txt
r2240139 r2307487 5 5 Tags: SEO, Readability, Content Analysis, Google Search Console, Google Analytics, SaaS, Competitive Analysis, Page Analysis, SERP Analysis, Search Engine Optimization, Bruce Clay 6 6 Requires at least: 4.5 7 Tested up to: 5. 3.27 Tested up to: 5.4.1 8 8 Requires PHP: 5.6 9 Stable tag: v0.7. 09 Stable tag: v0.7.1 10 10 License: GNU General Public License v3 11 11 License URI: https://www.gnu.org/licenses/gpl.html … … 110 110 == Changelog == 111 111 112 = 0.7.1 = 113 Release Date: May 18, 2020 114 115 Bugfixes: 116 * Fixes functionality to save Meta Description data and have that data reflect in the page statistics. 117 * Fixes session arrays to enable saving of data between different screens. 118 * Fixes dashboard UI issues like sorting and items per page for affected dashboard views. 119 112 120 = 0.7.0 - 113 121 Release Date: February 6, 2020 … … 232 240 233 241 = 0.7.0 = 242 Fixes bugs in saving Meta Description tags, signing up, and dashboard data. Upgrade now if you are unable to subscribe or are having trouble saving meta information for a post. 243 244 = 0.7.0 = 234 245 Fixes bugs in the UI, Yoast Compatibility, Settings and Chart components. Refactors code in order to do some more automated testing and documenting. Upgrade now if you have been seeing zeroes for data in Yoast fields, blank screens or charts or errors when saving settings. 235 246 -
bruce-clay-seo/trunk/seotoolset.php
r2240139 r2307487 17 17 * Plugin URI: https://www.bruceclay.com/seo/tools/bruceclayseo/ 18 18 * Description: Bruce Clay SEO gives blog writers on-page SEO guidance based on real-time competitor analysis. Analytics is integrated to show post performance, right in WordPress. Keyword tracking, reports and more powered by SEOToolSet. 19 * Version: 0.7. 019 * Version: 0.7.1 20 20 * Author: Bruce Clay, Inc. 21 21 * Author URI: https://www.bruceclay.com/?utm_source=bc-seo&utm_medium=plugin&utm_campaign=wordpress-general … … 49 49 * Current version of the plugin. 50 50 */ 51 define('SEOTOOLSET_VERSION', '0.7. 0');51 define('SEOTOOLSET_VERSION', '0.7.1'); 52 52 } 53 53 -
bruce-clay-seo/trunk/src/SEOToolSet.php
r2240164 r2307487 236 236 237 237 add_action('save_post', [$this, 'apiPostsPost']); 238 add_action('wp_ajax_saveMetaDescription', [$this, 'saveMetaDescription']); 238 239 239 240 if (is_admin()) { … … 256 257 } 257 258 } 259 258 260 259 261 /** … … 823 825 $userId = get_current_user_id(); 824 826 $expires = '30 minutes'; 825 update_user_meta($userId, "bcseo_{$key}", strtotime($expires) . ":" . $value); 827 if (is_array($value)) { 828 $value = json_encode($value); 829 } 830 update_user_meta($userId, "bcseo_{$key}", strtotime($expires) . "&" . $value); 826 831 } 827 832 … … 835 840 public static function getSessionVar($key) 836 841 { 842 $value = null; 837 843 $userId = get_current_user_id(); 838 $value = get_user_meta($userId, "bcseo_{$key}", true); 839 preg_match(';^([0-9]+):(.*)$;', $value, $regs); 840 return ($regs[1] < time()) ? null : $regs[2]; 844 $db_value = get_user_meta($userId, "bcseo_{$key}", true); 845 $splitted_value = explode('&', $db_value); 846 if (2 === count($splitted_value) && $splitted_value[0] > time()) { 847 $value = json_decode($splitted_value[1], true); 848 // Value is not JSON 849 if (JSON_ERROR_NONE !== json_last_error()) { 850 $value = $splitted_value[1]; 851 } 852 return $value; 853 } 854 return null; 841 855 } 842 856 … … 1060 1074 //wp_register_style('jquery-ui', '//ajax.googleapis.com/ajax/libs/jqueryui/1.9/themes/base/jquery-ui.css'); 1061 1075 //wp_enqueue_style('jquery-ui'); 1076 $this->localizeSaveMetaDescriptionScript(); 1077 } 1078 1079 /** 1080 * Function to localize script and register variables to save Meta Description 1081 */ 1082 public function localizeSaveMetaDescriptionScript() { 1083 global $post; 1084 wp_localize_script( 1085 'seotoolset-scripts', 1086 'seotoolset_vars', 1087 [ 1088 'ajax_url' => admin_url('admin-ajax.php'), 1089 'post_id' => $post->ID 1090 ] 1091 ); 1092 } 1093 1094 /** 1095 * Function to save Meta Description via AJAX 1096 */ 1097 public function saveMetaDescription() { 1098 global $wpdb; 1099 $response = []; 1100 if (!isset($_POST['seotoolset_post_id']) || 1101 !isset($_POST['seotoolset_meta_title']) || 1102 !isset($_POST['seotoolset_meta_description']) || 1103 $_POST['seotoolset_post_id'] == '' || 1104 $_POST['seotoolset_meta_title'] == '' || 1105 $_POST['seotoolset_meta_description'] == '') { 1106 $response = [ 1107 'status' => 400, 1108 'message' => 'All fields are mandatory to save Meta description data.' 1109 ]; 1110 echo json_encode($response); 1111 wp_die(); 1112 } 1113 $postId = sanitize_text_field(trim($_POST['seotoolset_post_id'])); 1114 $metaTitle = sanitize_text_field(trim($_POST['seotoolset_meta_title'])); 1115 $metaDescription = sanitize_text_field(trim($_POST['seotoolset_meta_description'])); 1116 if (!is_numeric($postId)) { 1117 $response = [ 1118 'status' => 400, 1119 'message' => 'There was an error getting post id.' 1120 ]; 1121 echo json_encode($response); 1122 wp_die(); 1123 } 1124 update_post_meta($postId, '_seotoolset_meta_title', $metaTitle); 1125 update_post_meta($postId, '_seotoolset_meta_description', $metaDescription); 1126 $response = [ 1127 'status' => 200, 1128 'message' => 'Meta description data was saved successfully.' 1129 ]; 1130 echo json_encode($response); 1131 wp_die(); 1062 1132 } 1063 1133 -
bruce-clay-seo/trunk/src/templates/ajax-dashboard-activity.php
r2240164 r2307487 50 50 foreach ($arr as $color => $colorActivities) { 51 51 $count = count($colorActivities); 52 $current_severity = false; 53 switch( $color ) { 54 case 'red': $current_severity = 'Error'; break; 55 case 'yellow': $current_severity = 'Warning'; break; 56 case 'green': $current_severity = 'Info'; break; 57 default: $current_severity = 'Error'; 58 } 52 59 ?> 53 60 <div class="collapsible<?php echo $color == 'red' ? '' : ' closed'; ?>"> … … 59 66 </h4> 60 67 <?php if ($count > 0) { ?> 61 <a class="reasons-view button" href="?page=seotoolset-activity"><?php _e('View All', SEOTOOLSET_TEXTDOMAIN); ?></a> 68 <a class="reasons-view button" 69 href="?page=seotoolset-activity<?php echo ( $current_severity ) ? '&severity=' . $current_severity : '' ?>"> 70 <?php _e('View All', SEOTOOLSET_TEXTDOMAIN); ?> 71 </a> 62 72 <?php } ?> 63 73 </div> 64 74 <div> 65 75 <table class="stripes"> 76 <?php $activities_count = 0; ?> 66 77 <?php foreach ($colorActivities as $act) { ?> 67 78 <?php 79 $activities_count++; 80 if( $activities_count > 10 ) { 81 break; 82 } 68 83 $alerts = &$act['alerts']; 69 84 $postId = $act['post_id']; -
bruce-clay-seo/trunk/src/templates/ajax-dashboard-content.php
r2240164 r2307487 36 36 $args2['DateRangeStart'] = $start; 37 37 $args2['DateRangeEnd'] = $end; 38 $args2['limit'] = '10'; 38 39 $contents = SEOToolSetAPI::apiRequest('GET', '/dashboard/content', $args2, $headers); 39 40 $http_code = $contents['meta']['http_code']; -
bruce-clay-seo/trunk/src/templates/ajax-post-meta-description.php
r2240164 r2307487 80 80 <div class="left one-third"> 81 81 <h4><?php _e('Meta Title', SEOTOOLSET_TEXTDOMAIN); ?></h4> 82 <input type="text" name="seotoolset_meta_title" value="<?php echo htmlspecialchars($postTitle); ?>">82 <input type="text" id="seotoolset_meta_title" name="seotoolset_meta_title" value="<?php echo htmlspecialchars($postTitle); ?>"> 83 83 84 84 <h4><?php _e('Meta Description', SEOTOOLSET_TEXTDOMAIN); ?></h4> 85 <textarea rows="5" name="seotoolset_meta_description"><?php echo htmlspecialchars($metaDesc); ?></textarea>85 <textarea rows="5" id="seotoolset_meta_description" name="seotoolset_meta_description"><?php echo htmlspecialchars($metaDesc); ?></textarea> 86 86 87 87 <div id="ajax-post-meta-keywords"> … … 93 93 <h4><?php _e('Snippet Preview', SEOTOOLSET_TEXTDOMAIN); ?></h4> 94 94 <p class="snippet"> 95 <a href="@@" ><?php echo $dispTitle; ?></a>95 <a href="@@" class="seotoolset_meta_title_label"><?php echo $dispTitle; ?></a> 96 96 <cite><?php echo $dispUrl; ?></cite><br> 97 <span ><?php echo $dispDesc; ?></span>97 <span class="seotoolset_meta_description_label"><?php echo $dispDesc; ?></span> 98 98 </p> 99 <div class="seo-meta-messages"></div> 99 100 </div> 100 101 -
bruce-clay-seo/trunk/src/templates/tabs.php
r2240164 r2307487 45 45 try { 46 46 if (/*!is_array($activities) && */ SEOToolSet::userIsLoggedInSubscribedWithProject()) { 47 $activities = SEOToolSetAPI::apiRequest('GET', '/dashboard/activity'); 47 if( isset( $_GET[ 'severity' ] ) ) { 48 $custom_args = []; 49 $custom_args[ 'severity' ] = sanitize_text_field( $_GET[ 'severity' ] ); 50 } 51 $activities = SEOToolSetAPI::apiRequest( 'GET', '/dashboard/activity', $custom_args ); 48 52 } 49 53 if (!is_array($activities)) {
Note: See TracChangeset
for help on using the changeset viewer.