Changeset 2904458
- Timestamp:
- 04/26/2023 12:18:09 PM (3 years ago)
- Location:
- automatic-articles-importer/trunk
- Files:
-
- 3 added
- 8 edited
-
assets/css/images (added)
-
assets/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png (added)
-
assets/css/jquery-ui.css (added)
-
assets/css/style-admin.css (modified) (8 diffs)
-
assets/js/zl-admin-custom.js (modified) (1 diff)
-
automatic-articles-importer.php (modified) (2 diffs)
-
classes/class-admin-menu.php (modified) (7 diffs)
-
classes/class-article-import.php (modified) (5 diffs)
-
classes/class-ziai-cron.php (modified) (1 diff)
-
includes/wp-ziai-article-form.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
automatic-articles-importer/trunk/assets/css/style-admin.css
r2849583 r2904458 1 .menu-icon-zl_ziai_article div img {1 .menu-icon-zl_ziai_article div img { 2 2 width: 100%; 3 3 height: auto; … … 59 59 } 60 60 61 61 62 /* Tool tip icon start*/ 63 62 64 .hint { 63 65 display: inline-block; … … 67 69 } 68 70 71 69 72 /* background style for 'i' */ 73 70 74 .hint-icon { 71 75 background: #a5acb5; … … 82 86 } 83 87 88 84 89 /* hint icon hover style */ 90 85 91 .hint-icon:hover { 86 92 background: #1170be; … … 88 94 } 89 95 96 90 97 /* Displays the hint. important! Do not remove. */ 98 91 99 .hint:hover .hint-description, 92 100 .hint:focus .hint-description { … … 94 102 } 95 103 104 96 105 /* position of the hint */ 106 97 107 .hint-description { 98 108 display: none; … … 114 124 } 115 125 126 116 127 /* styling for the arrow */ 128 117 129 .hint-description:before, 118 130 .hint-description:after { … … 127 139 } 128 140 141 129 142 /* overlay styling */ 130 .hint-description:after { 143 144 145 /* .hint-description:after { 131 146 left: 50%; 132 147 border-top-color: #f6f8fa; 133 148 bottom: -20px; 134 149 } 150 151 .lds-dual-ring.hidden { 152 display: none; 153 } 154 155 .lds-dual-ring { 156 display: inline-block; 157 width: 80px; 158 height: 80px; 159 } 160 161 .lds-dual-ring:after { 162 content: " "; 163 display: block; 164 width: 64px; 165 height: 64px; 166 margin: 23%; 167 margin-left: 51%; 168 border-radius: 50%; 169 border: 6px solid #fff; 170 border-color: #fff transparent #fff transparent; 171 animation: lds-dual-ring 1.2s linear infinite; 172 } 173 174 @keyframes lds-dual-ring { 175 0% { 176 transform: rotate(0deg); 177 } 178 100% { 179 transform: rotate(360deg); 180 } 181 } 182 183 .overlay { 184 position: fixed; 185 top: 0; 186 left: 0; 187 width: 100%; 188 height: 100vh; 189 background: rgba(0, 0, 0, .8); 190 z-index: 999; 191 opacity: 1; 192 transition: all 0.5s; 193 } */ 194 195 @keyframes spin { 196 from { 197 transform: rotate(0deg); 198 } 199 to { 200 transform: rotate(360deg); 201 } 202 } 203 204 .zl-spinner::before { 205 content: ''; 206 position: absolute; 207 background-color: #fbfbfc; 208 top: 4px; 209 left: 4px; 210 width: 6px; 211 height: 6px; 212 border: none; 213 border-radius: 100%; 214 transform-origin: 8px 8px; 215 animation-name: spin; 216 animation-duration: 1000ms; 217 animation-timing-function: linear; 218 animation-iteration-count: infinite; 219 } 220 221 .zl-spinner { 222 visibility: visible; 223 display: inline-block; 224 background-color: #23282d; 225 opacity: 0.75; 226 width: 24px; 227 height: 24px; 228 border: none; 229 border-radius: 100%; 230 padding: 0; 231 margin: 0 24px; 232 position: relative; 233 } -
automatic-articles-importer/trunk/assets/js/zl-admin-custom.js
r2849583 r2904458 1 jQuery(document).ready(function() { 2 var post_type = jQuery("select[name='zl_post_type_get']").val(); 1 jQuery(document).ready(function($) { 2 var post_type = $("select[name='zl_post_type_get']").val(); 3 var progressBar = $("#progressbar"); 4 var bulkImportBtn = $('#bulk-import'); 3 5 GetCategoryziai(post_type); 4 6 5 jQuery("select[name='zl_post_type_get']").on("change", function(){6 var post_type = jQuery(this).val();7 $("select[name='zl_post_type_get']").on("change", function() { 8 var post_type = $(this).val(); 7 9 GetCategoryziai(post_type); 8 10 }); 9 11 12 $(progressBar).progressbar({ 13 value: 0 14 }); 15 16 $(bulkImportBtn).click(function() { 17 fireBulkImporter(); 18 }); 19 20 10 21 function GetCategoryziai(post_type) { 11 jQuery.ajax({22 $.ajax({ 12 23 type: "POST", 13 24 url: wpAjax.ajaxUrl, 14 25 data: { action: "ziai_category_get", post_type: post_type }, 15 beforeSend: function () {16 jQuery(".zl-ajax-loader").css({ display: "inline-block" });26 beforeSend: function() { 27 $(".zl-ajax-loader").css({ display: "inline-block" }); 17 28 }, 18 success: function (result) {19 jQuery(".post_type_category").html(result);20 jQuery(".zl-ajax-loader").css({ display: "none" });29 success: function(result) { 30 $(".post_type_category").html(result); 31 $(".zl-ajax-loader").css({ display: "none" }); 21 32 }, 22 33 }); 23 34 } 35 36 function fireBulkImporter() { 37 let author = jQuery("#zl_default_author").val(); 38 let category = jQuery(".post_type_category [name='zl_taxonomie']").val(); 39 let api_key = jQuery("#ziai_access_token").val(); 40 $.ajax({ 41 type: "POST", 42 url: wpAjax.ajaxUrl, 43 data: { action: "ziai_bulk_importer_init", api_key: api_key, post_type: post_type, author: author, category: category }, 44 beforeSend: function() { 45 $(bulkImportBtn).toggleClass('disabled'); 46 $(bulkImportBtn).prop('disabled', true); 47 $('.zl-button .submit span').addClass('zl-spinner'); 48 }, 49 success: function(result) { 50 // makes it <result.pages.total_pages irl 51 result = JSON.parse(result); 52 let currentPage = result.pages.page + 1; 53 let maxPage = result.pages.total_pages; // set the maximum number of pages here 54 $(progressBar).progressbar({ 55 value: (result.pages.page / result.pages.total_pages) * 100 56 }); 57 58 function nextPage() { 59 if (currentPage <= maxPage) { 60 bulkImporterNextPage(currentPage, currentPage + 1, function() { 61 currentPage++; 62 nextPage(); 63 }); 64 } 65 } 66 67 nextPage(); 68 }, 69 }); 70 } 71 72 function bulkImporterNextPage(currentPage, nextPage, callback) { 73 $.ajax({ 74 type: "POST", 75 url: wpAjax.ajaxUrl, 76 data: { 77 action: "ziai_bulk_importer_get_page", 78 currentPage: currentPage, 79 nextPage: nextPage 80 }, 81 success: function(result) { 82 result = JSON.parse(result); 83 if (callback) { 84 callback(); 85 } 86 $(progressBar).progressbar({ 87 value: (result.pages.page / result.pages.total_pages) * 100 88 }); 89 if (result.pages.page === result.pages.total_pages) { 90 bulkImporterComplete(); 91 } 92 }, 93 error: function(jqXHR, textStatus, errorThrown) { 94 console.log("Error:", textStatus, errorThrown); 95 } 96 }); 97 } 98 99 function bulkImporterComplete() { 100 $(bulkImportBtn).toggleClass('disabled'); 101 $(bulkImportBtn).prop('disabled', false); 102 $('.zl-button .submit span').removeClass('zl-spinner'); 103 $(progressBar).progressbar({ 104 value: 0 105 }); 106 } 24 107 }); -
automatic-articles-importer/trunk/automatic-articles-importer.php
r2849583 r2904458 5 5 * Description: This plugin is used to import articles from Intercom Service. 6 6 * Plugin URI: https://www.zluck.com/ 7 * Version: 1. 07 * Version: 1.1 8 8 * Author: Zluck Solutions 9 9 * Author URI: https://profiles.wordpress.org/zluck … … 22 22 include_once('classes/class-ziai-cron.php'); 23 23 24 ZIAI_Modules::ziai_init(); 24 $ZIAI_Modules = new ZIAI_Modules(); 25 $ZIAI_Modules->ziai_init(); 25 26 ZIAI_CronJob::ziai_cron_init(); -
automatic-articles-importer/trunk/classes/class-admin-menu.php
r2849583 r2904458 1 1 <?php 2 2 class ZIAI_Modules { 3 public static function ziai_init() { 4 add_action( 'admin_enqueue_scripts', array( __CLASS__, 'ziai_load_admin_style' ) ); 5 add_action( 'admin_menu', array( __CLASS__, 'ziai_register_menu_page' ) ); 6 add_action('wp_ajax_ziai_category_get', array( __CLASS__, 'ziai_category_get' )); 7 add_action('wp_ajax_nopriv_ziai_category_get', array( __CLASS__, 'ziai_category_get' )); 8 add_action('init', array( __CLASS__, 'ziai_register_post_type' )); 9 } 10 11 public static function ziai_register_menu_page() { 3 public function ziai_init() { 4 add_action( 'admin_enqueue_scripts', array( $this, 'ziai_load_admin_style' ) ); 5 add_action( 'admin_menu', array( $this, 'ziai_register_menu_page' ) ); 6 add_action('wp_ajax_ziai_category_get', array( $this, 'ziai_category_get' )); 7 add_action('wp_ajax_ziai_bulk_importer_init', array( $this, 'ziai_bulk_importer_init' )); 8 add_action('wp_ajax_ziai_bulk_importer_get_page', array( $this, 'ziai_bulk_importer_get_page' )); 9 add_action('wp_ajax_nopriv_ziai_category_get', array( $this, 'ziai_category_get' )); 10 add_action('init', array( $this, 'ziai_register_post_type' )); 11 } 12 13 public function ziai_register_menu_page() { 12 14 add_submenu_page( 13 15 'edit.php?post_type=zl_ziai_article', … … 16 18 'manage_options', 17 19 'ziai-articles', 18 array( __CLASS__, 'ziai_admin_show_data' ) 19 ); 20 } 21 22 public static function ziai_load_admin_style() { 20 array( $this, 'ziai_admin_show_data' ) 21 ); 22 } 23 24 public function ziai_load_admin_style() { 25 wp_enqueue_style( 'jquery-ui-progressbar', ZIAI_FILE_URL . 'assets/css/jquery-ui.css'); 23 26 wp_enqueue_style( 'ziai_admin_style_css', ZIAI_FILE_URL . 'assets/css/style-admin.css'); 27 wp_enqueue_script('jquery-ui-progressbar'); 24 28 wp_enqueue_script('zl_admin_custom_script', ZIAI_FILE_URL . 'assets/js/zl-admin-custom.js', array('jquery'), '1.0', true); 25 29 wp_localize_script('zl_admin_custom_script', 'wpAjax', array('ajaxUrl' => admin_url('admin-ajax.php'))); 26 30 } 27 31 28 public staticfunction ziai_admin_show_data() {32 public function ziai_admin_show_data() { 29 33 if ( is_file(ZIAI_FILE_PATH . 'includes/wp-ziai-article-form.php') ) { 34 $errormsg = false; 30 35 $token = get_option('zl_ziai_access_token'); 31 36 $post_type = get_option('zl_post_type_get'); … … 57 62 $errormsg = "Articles settings updated successfully!!"; 58 63 if (isset($_POST['runnow'])) { 59 $arry = array( 60 "access_token" => $token, 61 "import_post_type" => $post_type, 62 "import_author" => $zl_default_author, 63 "import_taxonomy" => $taxonomies, 64 ); 64 $arry = $this->get_ziai_options_array(); 65 65 $importer_article = new ZIAI_Handler($arry); 66 $response = $importer_article->ziai_import_article(); 67 if ($response['status'] == 'errors') { 68 $errormsg = $response['message']; 69 } else { 70 $errormsg = 'Message:- ' . $response['message'] . '<br>'; 71 $errormsg .= 'Episodes:- ' . $response['count'] .' Article Import'; 72 //$errormsg .= 'Episodes:- '.$response['episodes']; 66 $response = $importer_article->sync_articles(); 67 if($response){ 68 if ($response['status'] == 'errors') { 69 $errormsg = $response['message']; 70 } else { 71 $errormsg = 'Message:- ' . $response['message'] . '<br>'; 72 $errormsg .= 'Episodes:- ' . $response['count'] .' Article Import'; 73 } 73 74 } 74 75 } … … 78 79 } 79 80 81 public function get_ziai_options_array(){ 82 $token = get_option('zl_ziai_access_token'); 83 $post_type = get_option('zl_post_type_get'); 84 $taxonomies = get_option('zl_taxonomy_get'); 85 $zl_default_author = get_option('zl_default_author'); 86 return array( 87 "access_token" => $token, 88 "import_post_type" => $post_type, 89 "import_author" => $zl_default_author, 90 "import_taxonomy" => $taxonomies, 91 ); 92 } 93 80 94 //Post Category Get 81 public staticfunction ziai_category_get()95 public function ziai_category_get() 82 96 { 83 97 $post_type = 'zl_ziai_article'; … … 99 113 } 100 114 115 public function ziai_bulk_importer_init() 116 { 117 update_option('zl_taxonomy_get', $_POST['category']); 118 update_option('zl_default_author', $_POST['author']); 119 update_option('zl_post_type_get', $_POST['post_type']); 120 update_option('zl_ziai_access_token', $_POST['api_key']); 121 122 $arry = $this->get_ziai_options_array(); 123 $importer_article = new ZIAI_Handler($arry); 124 $response = $importer_article->get_articles(1, 25); 125 echo json_encode($response); 126 die(); 127 } 128 129 public function ziai_bulk_importer_get_page() 130 { 131 $page = $_POST['currentPage']; 132 $arry = $this->get_ziai_options_array(); 133 $importer_article = new ZIAI_Handler($arry); 134 $response = $importer_article->get_articles($page, 25); 135 echo json_encode($response); 136 die(); 137 } 138 101 139 //custom Post Type 102 public staticfunction ziai_register_post_type()140 public function ziai_register_post_type() 103 141 { 104 142 $cpt_name = 'Automatic Articles Importer'; … … 135 173 'hierarchical' => true, 136 174 ); 175 137 176 register_post_type('zl_ziai_article', $args); 177 138 178 $taxonomys = 'Collection'; 139 179 $taxonomyp = 'Collections'; … … 152 192 'not_found' => __('No ' . $taxonomys . ' found.'), 153 193 ); 194 154 195 register_taxonomy('article-cat', array('zl_ziai_article'), array( 155 196 'hierarchical' => true, -
automatic-articles-importer/trunk/classes/class-article-import.php
r2849583 r2904458 17 17 } 18 18 19 public function ziai_import_article() 20 { 21 $response = wp_remote_get( 'https://api.intercom.io/articles/?per_page=-1', 19 public function sync_articles(){ 20 $response = $this->get_articles(1, 25); 21 if($response['pages']['total_pages'] > 1){ 22 $this->get_more_articles($response['pages']['page']+1, $response['pages']['total_pages']); 23 } 24 } 25 26 private function get_more_articles($current_page, $max_page) { 27 if ($current_page > $max_page) { 28 return; 29 } 30 31 $this->get_articles($current_page, $current_page + 1, 32 function($current_page, $max_page) { 33 $current_page++; 34 $this->get_more_articles($current_page, $max_page); 35 }); 36 } 37 38 public function get_articles($page=null, $per_page=null, $callback=false){ 39 $endpoint = 'https://api.intercom.io/articles/'; 40 $params = http_build_query(array( 41 'page' => $page, 42 'per_page' => $per_page 43 )); 44 if($params){ 45 $endpoint .= '?'.$params; 46 } 47 $response = wp_remote_get( $endpoint, 22 48 array( 23 49 'method' => 'GET', … … 30 56 $response = json_decode($response['body'], true); 31 57 if(!isset($response['errors'])){ 58 $imported_articles = $this->ziai_import_articles($response); 59 if($callback){ 60 $callback($page, $response['pages']['total_pages']); 61 } else { 62 return $response; 63 } 64 } else { 65 return array( 66 'status' => 'errors', 67 'message' => $response['errors'][0]->message, 68 ); 69 } 70 } 71 72 public function ziai_import_articles($response) 73 { 74 if (isset($response['errors'])) { 75 return [ 76 'status' => 'errors', 77 'message' => $response['errors'][0]->message, 78 ]; 79 } else { 80 // Get collection data from api for given article parent_id 32 81 foreach($response['data'] as $data){ 33 $collection = wp_remote_get( 'https://api.intercom.io/help_center/collections/'.$data['parent_id'].'', 34 array( 35 'method' => 'GET', 36 'headers' => array( 37 'Authorization' => 'Bearer ' . $this->access_token 38 ) 39 ) 40 ); 41 42 $collection = json_decode($collection['body'], true); 43 $article = array( 44 'id' => $data['id'], 45 'title' => $data['title'], 46 'content' => $data['body'], 47 'status' => $data['state'], 48 'collection' => $collection['name'] 49 ); 50 $this->ziai_create_article($article); 82 // If the article exists, we don't need to call for the collection data 83 $article_exists = $this->is_article_imported($data['id']); 84 $collection = null; 85 if(!$article_exists){ 86 $this->create_update_article($data); 87 } else { 88 //$article_wp_object = get_post($article_exists); 89 $out_of_date = $this->is_article_outdated($article_exists, $data); 90 if($out_of_date){ 91 $this->create_update_article($data); 92 } 93 } 51 94 } 52 95 return array( … … 56 99 'episodes' => $this->ziai_imported, 57 100 ); 58 }else{ 59 return array( 60 'status' => 'errors', 61 'message' => $response['errors'][0]->message, 62 ); 63 } 64 } 65 101 } 102 } 103 104 /** 105 * Checks if a WordPress article is out of date with Intercom. 106 * 107 * @param int $article_id The post ID of the article. 108 * @param array $data An array of article data from the Intercom API. 109 * @return bool True if the article is outdated, false otherwise. 110 */ 111 public function is_article_outdated(int $article_id, array $data): bool { 112 $article_wp_date_modified = get_post_meta($article_id, 'intercom_updated_at', true); 113 return ($data['updated_at'] > $article_wp_date_modified); 114 } 115 116 public function get_collection_data($data){ 117 $collection = wp_remote_get( 'https://api.intercom.io/help_center/collections/'.$data['parent_id'].'', 118 array( 119 'method' => 'GET', 120 'headers' => array( 121 'Authorization' => 'Bearer ' . $this->access_token 122 ) 123 ) 124 ); 125 126 return json_decode($collection['body'], true); 127 } 128 129 /** 130 * Checks to see if an article has been previously imported into WordPress 131 * 132 * @param int $article_id The article_id as provided by the Intercom API 133 * @return int|bool The post ID of the matching post if found, or false if not found. 134 */ 135 public function is_article_imported(int $article_id): bool|int 136 { 137 $exists = false; 138 $args = array( 139 'post_type' => $this->post_type, 140 'post_status' => array('publish', 'draft'), 141 'meta_query' => array( 142 array( 143 'key' => 'zl_ziai_id', 144 'value' => $article_id, 145 'compare' => '=', 146 ) 147 ) 148 ); 149 150 $already_added = get_posts($args); 151 if ($already_added) { 152 $exists = $already_added[0]->ID; 153 } 154 155 return $exists; 156 } 157 158 public function create_update_article($data){ 159 if(isset($data['parent_id'])){ 160 $collection = $this->get_collection_data($data); 161 } 162 163 $article = array( 164 'id' => $data['id'], 165 'title' => $data['title'], 166 'content' => $data['body'], 167 'status' => $data['state'], 168 'created_at' => $data['created_at'], 169 'updated_at' => $data['updated_at'], 170 'collection'=> $collection['name'] ?? null, 171 ); 172 173 $this->ziai_create_article($article); 174 } 66 175 protected function ziai_create_article($article) 67 176 { … … 83 192 } 84 193 194 85 195 public function ziai_get_post_data($article) 86 196 { 87 $term_a = term_exists($article['collection'], $this->taxonomy); 88 $term_a_id = $term_a['term_id']; 89 if(empty($term_a_id)){ 90 wp_insert_term( 91 $article['collection'], 92 $this->taxonomy, 93 array( 94 // 'description'=> 'Some description.', 95 'slug' => str_replace(" ", "-", $article['collection']), 96 ) 97 ); 197 $term_a = false; 198 $post_data = array(); 199 if(isset($article['collection'])){ 200 $term_a = term_exists($article['collection'], $this->taxonomy); 201 $term_a_id = $term_a['term_id']; 202 if(empty($term_a_id)){ 203 wp_insert_term( 204 $article['collection'], 205 $this->taxonomy, 206 array( 207 // 'description'=> 'Some description.', 208 'slug' => str_replace(" ", "-", $article['collection']), 209 ) 210 ); 211 } 212 $term_a = term_exists($article['collection'], $this->taxonomy); 213 $term_id = $term_a['term_id']; 214 $post_data['post_category'] = array($term_id); 98 215 } 99 216 100 217 $status = ($article['status'] == 'published') ? $article['status'] = 'publish' : $article['status']; 101 $term_a = term_exists($article['collection'], $this->taxonomy);102 $term_id = $term_a['term_id'];103 $post_data = array();104 218 $post_data['post_content'] = $article['content']; 105 219 $post_data['post_title'] = $article['title']; … … 107 221 $post_data['post_author'] = $this->post_author; 108 222 $post_data['post_type'] = $this->post_type; 109 $post_data['post_category'] = array($term_id); 223 110 224 $post_data['meta_input'] = array( 111 225 'zl_ziai_id' => $article['id'], 112 ); 113 114 $args = array( 115 'post_type' => $this->post_type, 116 'post_status' => array('publish', 'draft'), 117 'meta_query' => array( 118 array( 119 'key' => 'zl_ziai_id', 120 'value' => $article['id'], 121 'compare' => '=', 122 ) 123 ) 124 ); 125 126 $already_added = new WP_Query($args); 127 if ($already_added->have_posts()) { 128 $already_added->the_post(); 129 $post_id = get_the_ID(); 130 $post_data['ID'] = $post_id; 226 'intercom_created_at' => $article['created_at'], 227 'intercom_updated_at' => $article['updated_at'] 228 ); 229 230 // Find the article in WP 231 $article_exists = $this->is_article_imported($article['id']); 232 if($article_exists ){ 233 $post_data['ID'] = $article_exists; 131 234 } 132 235 -
automatic-articles-importer/trunk/classes/class-ziai-cron.php
r2849583 r2904458 52 52 public static function ziai_get_articles_using_cron() 53 53 { 54 // here's the function we'd like to call with our cron job 55 $token = get_option('zl_ziai_access_token'); 56 $post_type = get_option('zl_post_type_get'); 57 $category = get_option('zl_category_get'); 58 $taxonomies = get_option('zl_taxonomy_get'); 59 $zl_default_author = get_option('zl_default_author'); 60 $arry = array( 61 "access_token" => $token, 62 "import_post_type" => $post_type, 63 "import_author" => $zl_default_author, 64 "import_taxonomy" => $taxonomies, 65 ); 66 $importer_article = new ZIAI_Handler($arry); 67 $importer_article->ziai_import_article(); 54 $ZIAI_Modules = new ZIAI_Modules(); 55 $arry = $ZIAI_Modules->get_ziai_options_array(); 56 $importer_article = new ZIAI_Handler($arry); 57 $importer_article->sync_articles(); 68 58 } 69 59 } -
automatic-articles-importer/trunk/includes/wp-ziai-article-form.php
r2849583 r2904458 1 1 <div class="wrap wp-ziai-article"> 2 2 <h1><?php esc_html_e('Automatic Articles Settings', 'ziai-articles'); ?></h1> 3 <?php 4 // wp_enqueue_script('jquery-ui-progressbar'); 5 // $wp_scripts = wp_scripts(); 6 // wp_enqueue_style('plugin_name-admin-ui-css', 7 // 'http://ajax.googleapis.com/ajax/libs/jqueryui/' . $wp_scripts->registered['jquery-ui-core']->ver . '/themes/smoothness/jquery-ui.css', 8 // false, 9 // 1.0, 10 // false); 11 ?> 3 12 <div id="wpbody" role="main"> 4 13 <div id="wpbody-content"> … … 10 19 <div class="col-wrap"> 11 20 <div class="form-wrap"> 12 <p><?php _e($errormsg, 'ziai-articles'); ?></p> 21 <?php 22 if($errormsg) { ?> 23 <p><?php _e($errormsg, 'ziai-articles'); ?></p> 24 <?php 25 } 26 ?> 13 27 <form method="post" action="" class="validate zl-admin-form"> 28 <div id="loader" class="lds-dual-ring hidden overlay"></div> 29 <div id="progressbar"></div><br> 14 30 <div class="zl-ziai-setting zl-setting-2"> 15 31 <div class="form-field form-required term-name-wrap"> … … 20 36 </div> 21 37 </label> 22 <input name="ziai_access_token" id="ziai_access_token" type="text" value="<?php echo esc_attr($token); ?>" aria-required="true" required/> 38 <input name="ziai_access_token" id="ziai_access_token" type="text" <?php if($token != ''){ ?> value="<?php echo esc_attr($token); ?>" <?php } ?> aria-required="true" required/> 39 </div> 40 <br> 41 <div class="zl-button"> 42 <!-- <div style="padding: 10px 0;"> --> 43 <p class="submit"> 44 <button type="button" class="button button-primary" id="bulk-import">Import All</button><span class=""></span> 45 </p> 46 <!-- </div> --> 47 <div></div> 23 48 </div> 24 49 </div> … … 66 91 wp_nonce_field('zl-ziai-settings-save', 'zl-ziai-settings'); 67 92 submit_button('Save Changes', 'primary', 'savechanges'); 68 submit_button('Save & Run Now', 'primary runnow', 'runnow');93 //submit_button('Save & Run Now', 'primary runnow', 'runnow'); 69 94 ?> 95 <!-- <div style="padding: 10px 0;"> --> 96 <!-- <p class="submit"> 97 <button type="button" class="button button-primary" id="bulk-import">Import All</button><span class=""></span> 98 </p> --> 99 <!-- </div> --> 70 100 <div></div> 71 101 </div> 72 102 </div> 73 103 </form> 104 <!-- <div> 105 <h5>Bulk Importer</h5> 106 <div id="progressbar"></div> 107 <div style="padding: 10px 0;"> 108 <button class="button button-primary" id="bulk-import">Import All</button> 109 </div> 110 </div> --> 74 111 </div> 75 112 </div> -
automatic-articles-importer/trunk/readme.txt
r2849660 r2904458 14 14 == Description == 15 15 16 Automatic Articles Importer is an easy, quick and advanced plugin to import intercom articles. This plugin gives you ability to import the Intercom articles in your website easily. This plugin collects the intercom articles & collections from intercom and import on your website by collection wise. 16 Automatic Articles Importer is an easy, quick and advanced plugin to import intercom articles. 17 18 This plugin gives you ability to import the Intercom articles in your website easily. This plugin collects the intercom articles & collections from intercom and import on your website by collection wise. 17 19 18 20 19 21 == Key Features == 20 22 21 *Scheduled import process22 *Import intercom articles23 *Import intercom collection24 *Sync articles regulary by cron23 - Scheduled import process 24 - Import intercom articles 25 - Import intercom collection 26 - Sync articles regulary by cron 25 27 26 28 … … 63 65 == Changelog == 64 66 67 = 1.1 = 68 * Ability to import all articles 69 * Added pagination 70 * Other minor bugs fixes 71 65 72 = 1.0 = 66 73 * Initial Launch
Note: See TracChangeset
for help on using the changeset viewer.