/** * The actions index method * @param array $request * @return array */ public function executeIndex($request) { // return an array of name value pairs to send data to the template $data = array(); $helperObj = new WPImporter_includes_helper(); $data['common_notice'] = $helperObj->common_notice_for_pro_feature(); return $data; }
protected function get_upload_path($file_name = null, $version = null) { $HelperObj = new WPImporter_includes_helper(); $uploadDir = $HelperObj->uploadDir; $file_name = $file_name ? sanitize_file_name($file_name) : ''; if (empty($version)) { $version_path = ''; } else { $version_dir = @$this->options['image_versions'][$version]['upload_dir']; if ($version_dir) { return $version_dir . $this->get_user_path() . $file_name; } $version_path = $version . '/'; } $uploadpath = sanitize_text_field($_REQUEST['uploadPath']); $file_name = $HelperObj->convert_string2hash_key($file_name); // Code added by Fredrick Marks return $uploadpath . '/' . $uploadDir . '/' . $this->get_user_path() . $version_path . $file_name; }
<?php if (!defined('ABSPATH')) { exit; } // Exit if accessed directly $filename = isset($_POST['filename']) ? $_POST['filename'] : ''; $count = isset($_POST['corecount']) ? $_POST['corecount'] : ''; $impobj = new WPImporter_includes_helper(); $getrec = $impobj->csv_file_data($filename); $csvheaders = $impobj->headers; $returndata = "<table><tr><td><input type='text' name='coremapping{$count}' id = 'coremapping{$count}'/></td>"; $returndata .= "<td class='left_align'> <select name='coretextbox{$count}' id='coretextbox{$count}' class='uiButton'>"; $returndata .= "<option id = 'select'>-- Select --</option>"; foreach ($csvheaders as $headerkey => $headervalue) { $returndata .= "<option value = 'textbox{$headerkey}'>{$headervalue}</option>"; } $returndata .= "</select></td>"; $returndata .= "<td></td><td></td></tr></table>"; print_r($returndata); die;
$HelperObj = new WPImporter_includes_helper(); $settings = $HelperObj->getSettings(); if (current_user_can('administrator')) { if ($current_user->ID != 0) { $upload_handler = new UploadHandler(); } } if (isset($settings['enable_plugin_access_for_author']) && $settings['enable_plugin_access_for_author'] == 'enable_plugin_access_for_author') { if (current_user_can('author') || current_user_can('editor')) { if ($current_user->ID != 0) { $upload_handler = new UploadHandler(); } } } } else { if (current_user_can('author') || current_user_can('editor')) { $HelperObj = new WPImporter_includes_helper(); $settings = $HelperObj->getSettings(); if (isset($settings['enable_plugin_access_for_author']) && $settings['enable_plugin_access_for_author'] == 'enable_plugin_access_for_author') { if ($current_user->ID != 0) { $upload_handler = new UploadHandler(); } } } else { if (current_user_can('administrator')) { if ($current_user->ID != 0) { $upload_handler = new UploadHandler(); } } } }
* The interactive user interfaces in original and modified versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License * version 3, these Appropriate Legal Notices must retain the display of the * WP Ultimate CSV Importer copyright notice. If the display of the logo is * not reasonably feasible for technical reasons, the Appropriate Legal * Notices must display the words * "Copyright Smackcoders. 2014. All rights reserved". ********************************************************************************/ if (!defined('ABSPATH')) { exit; } // Exit if accessed directly $impCE = new WPImporter_includes_helper(); ?> <div id="support_con"> <div style="width:99%;"> <div class= "contactus" id="contactus" style="height:480px"> <div class="title"> <h3><?php echo __('Video Walk Through', 'wp-ultimate-csv-importer'); ?> </h3> </div> <div id="data" > <div id="video"> <iframe width="560" height="315" src="//www.youtube.com/embed/FhTUXE5zk0o?list=PL2k3Ck1bFtbRli9VdJaqwtzTSzzkOrH4j" frameborder="0" allowfullscreen></iframe>
* The interactive user interfaces in original and modified versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License * version 3, these Appropriate Legal Notices must retain the display of the * WP Ultimate CSV Importer copyright notice. If the display of the logo is * not reasonably feasible for technical reasons, the Appropriate Legal * Notices must display the words * "Copyright Smackcoders. 2015. All rights reserved". ********************************************************************************/ if (!defined('ABSPATH')) { exit; } // Exit if accessed directly $impCE = new WPImporter_includes_helper(); $nonce_Key = $impCE->create_nonce_key(); ?> <div style="width:100%;"> <div id="accordion"> <table class="table-importer"> <tr> <td> <h3><?php echo __('CSV Import Options', 'wp-ultimate-csv-importer'); ?> </h3> <div id='sec-one' <?php if ($_REQUEST['step'] != 'uploadfile') {
/** * @param $post_content * @param $postID * @return array */ public function capture_all_shortcodes($post_content, $postID) { $result = array(); $pattern = "/([WPIMPINLINE:([\\w]+)(.*?)(])/"; $shortcode_prefix = "[WPIMPINLINE:"; $post_content = str_replace("\n", "<br />", $post_content); preg_match_all($pattern, $post_content, $results, PREG_PATTERN_ORDER); $inlineimg_shortcodes = array(); $inline_shortcode_count = 0; for ($i = 0; $i < count($results[0]); $i++) { $get_shortcode_pos = strpos($results[0][$i], $shortcode_prefix); $inlineimg_shortcodes[] = substr($results[0][$i], $get_shortcode_pos); } $inline_shortcode_count = count($inlineimg_shortcodes); if (!empty($inlineimg_shortcodes) && is_array($inlineimg_shortcodes)) { foreach ($inlineimg_shortcodes as $shortkey => $shortcode) { $get_inlineimage_val = substr($shortcode, "13", -1); $image_attribute = explode('|', $get_inlineimage_val); $get_inlineimage_val = $image_attribute[0]; $uploadDir = wp_upload_dir(); $inlineimageDir = $uploadDir['basedir'] . '/smack_inline_images'; $inlineimageURL = $uploadDir['baseurl'] . '/smack_inline_images'; $wp_media_url = $uploadDir['baseurl']; $get_media_settings = get_option('uploads_use_yearmonth_folders'); if ($get_media_settings == 1) { $dirname = date('Y') . '/' . date('m'); $full_path = $uploadDir['basedir'] . '/' . $dirname; $baseurl = $uploadDir['baseurl'] . '/' . $dirname; } else { $full_path = $uploadDir['basedir']; $baseurl = $uploadDir['baseurl']; } $wp_media_path = $full_path; $eventKey = sanitize_text_field($_POST['postdata']['uploadedFile']); $inlineimageDirpath = $inlineimageDir . '/' . $eventKey; $imagelist = scanDirectories($inlineimageDirpath); $currentLoc = ''; if (!$imagelist) { $noimage = WP_CONST_ULTIMATE_CSV_IMP_DIR . "images/noimage.png"; $oldWord = $shortcode; $newWord = '<img src="' . $noimage . '" />'; $post_content = str_replace($oldWord, $newWord, $post_content); $result['post_content'] = $post_content; $result['inlineimage_shortcode'] = "No-Image-count:" . $inline_shortcode_count; } else { if (!empty($imagelist)) { foreach ($imagelist as $imgwithloc) { if (strpos($imgwithloc, $get_inlineimage_val)) { $currentLoc = $imgwithloc; } } } $exploded_currentLoc = explode("{$eventKey}", $currentLoc); if (!empty($exploded_currentLoc) && isset($exploded_currentLoc[1])) { $inlimg_curr_loc = $exploded_currentLoc[1]; } else { $inlimg_curr_loc = ''; } $inlineimageURL = $inlineimageURL . '/' . $eventKey . $inlimg_curr_loc; $helperObj = new WPImporter_includes_helper(); $helperObj->get_fimg_from_URL($inlineimageURL, $wp_media_path, $get_inlineimage_val, '', '', ''); $wp_media_path = $wp_media_path . "/" . $get_inlineimage_val; if (@getimagesize($wp_media_path)) { $img = wp_get_image_editor($wp_media_path); if (!is_wp_error($img)) { $sizes_array = array(array('width' => 1024, 'height' => 768, 'crop' => true), array('width' => 100, 'height' => 100, 'crop' => false), array('width' => 300, 'height' => 100, 'crop' => false), array('width' => 624, 'height' => 468, 'crop' => false)); $resize = $img->multi_resize($sizes_array); } $get_inline_guid = str_replace(' ', '-', $get_inlineimage_val); $inline_file['guid'] = $baseurl . "/" . $get_inlineimage_val; $inline_file['post_title'] = $get_inlineimage_val; $inline_file['post_content'] = ''; $inline_file['post_status'] = 'attachment'; $wp_upload_dir = wp_upload_dir(); $attachment = array('guid' => $inline_file['guid'], 'post_mime_type' => 'image/jpeg', 'post_title' => preg_replace('/\\.[^.]+$/', '', @basename($inline_file['guid'])), 'post_content' => '', 'post_status' => 'inherit'); if ($get_media_settings == 1) { $generate_attachment = $dirname . '/' . $get_inline_guid; } else { $generate_attachment = $get_inline_guid; } $uploadedImage = $wp_upload_dir['path'] . '/' . $get_inlineimage_val; //duplicate check global $wpdb; $existing_attachment = array(); //$query = $wpdb->get_results("select post_title from $wpdb->posts where post_type = 'attachment' and post_mime_type = 'image/jpeg'"); $query = $wpdb->get_results($wpdb->prepare("select post_title from {$wpdb->posts} where post_type = %s and post_mime_type = %s", 'attachment', 'image/jpeg')); if (!empty($query)) { foreach ($query as $key) { $existing_attachment[] = $key->post_title; } } //duplicate check if (!in_array($attachment['post_title'], $existing_attachment)) { $attach_id = wp_insert_attachment($attachment, $generate_attachment, $postID); $attach_data = wp_generate_attachment_metadata($attach_id, $uploadedImage); wp_update_attachment_metadata($attach_id, $attach_data); //set_post_thumbnail($postID, $attach_id); } // if($shortcode_mode == 'Inline') { $oldWord = $shortcode; $image_attribute[1] = isset($image_attribute[1]) ? $image_attribute[1] : ''; $image_attribute[2] = isset($image_attribute[2]) ? $image_attribute[2] : ''; $image_attribute[3] = isset($image_attribute[3]) ? $image_attribute[3] : ''; $newWord = '<img src="' . $inline_file['guid'] . '" ' . $image_attribute[1] . ' ' . $image_attribute[2] . ' ' . $image_attribute[3] . ' />'; $post_content = str_replace($oldWord, $newWord, $post_content); $result['post_content'] = $post_content; $result['inlineimage_shortcode'] = $inline_shortcode_count; // } } } } } return $result; }
* The interactive user interfaces in original and modified versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License * version 3, these Appropriate Legal Notices must retain the display of the * WP Ultimate CSV Importer copyright notice. If the display of the logo is * not reasonably feasible for technical reasons, the Appropriate Legal * Notices must display the words * "Copyright Smackcoders. 2014. All rights reserved". ********************************************************************************/ if (!defined('ABSPATH')) { exit; } // Exit if accessed directly $impObj = new WPImporter_includes_helper(); $nonceKey = $impObj->create_nonce_key(); if (!wp_verify_nonce($nonceKey, 'smack_nonce')) { die('You are not allowed to do this operation.Please contact your admin.'); } $impCheckobj = CallWPImporterObj::checkSecurity(); if ($impCheckobj != 'true') { die($impCheckobj); } global $wpdb; $all_arr = array(); $all_arr = $_REQUEST['postdata']; $all_arr = $all_arr[0]; if ($all_arr['action'] == 'file_exist_check') { $file_with_version = $all_arr['filename']; $temp_arr = array();
* WP Ultimate CSV Importer copyright notice. If the display of the logo is * not reasonably feasible for technical reasons, the Appropriate Legal * Notices must display the words * "Copyright Smackcoders. 2015. All rights reserved". ********************************************************************************/ if (!defined('ABSPATH')) { exit; } // Exit if accessed directly require_once WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . '/includes/WPImporter_includes_helper.php'; ?> <div style="width:100%;"> <div id="accordion"> <?php $impCE = new WPImporter_includes_helper(); $nonce_Key = $impCE->create_nonce_key(); ?> <table class="table-importer"> <tr> <td> <h3><?php echo esc_html__('CSV Import Options', 'wp-ultimate-csv-importer'); ?> </h3> <div id='sec-one' <?php if (sanitize_text_field($_REQUEST['step']) !== 'uploadfile') { ?> style='display:none;' <?php
/** * function to map the csv file and process it * * @return boolean */ function processDataInWP($data_rows, $ret_array, $session_arr, $currentLimit, $extractedimagelocation, $importinlineimageoption, $sample_inlineimage_url = null) { global $wpdb; $post_id = ''; $new_post = array(); $smack_taxo = array(); $custom_array = array(); $corecustom_arr = array(); $seo_custom_array = array(); $imported_feature_img = array(); $headr_count = $ret_array['h2']; //for ($i = 0; $i < count($data_rows); $i++) { for ($i = 0; $i <= $ret_array['basic_count']; $i++) { if (array_key_exists('corefieldname' . $i, $ret_array)) { if ($ret_array['coremapping' . $i] != '-- Select --' && $ret_array['coremapping' . $i] != '') { $mappedindex = str_replace('CF: ', '', $ret_array['corefieldname' . $i]); if (array_key_exists($ret_array['coremapping' . $i], $data_rows)) { $new_post[$mappedindex] = $data_rows[$ret_array['coremapping' . $i]]; $corecustom_arr[$mappedindex] = $data_rows[$ret_array['coremapping' . $i]]; } } } else { if (array_key_exists('seofieldname' . $i, $ret_array)) { if ($ret_array['seomapping' . $i] != '-- Select --' && $ret_array['seomapping' . $i] != '') { $mappedindex = str_replace('SEO: ', '', $ret_array['seofieldname' . $i]); if (array_key_exists($ret_array['seomapping' . $i], $data_rows)) { //$new_post[$mappedindex] = $data_rows[$ret_array['seomapping'.$i]]; $seo_custom_array[$mappedindex] = $data_rows[$ret_array['seomapping' . $i]]; } } } else { if (array_key_exists('addcorefieldname' . $i, $ret_array)) { if ($ret_array['addcoremapping' . $i] != '-- Select --' && $ret_array['addcoremapping' . $i] != '') { if (array_key_exists($ret_array['addcoremapping' . $i], $data_rows)) { $corecustom_arr[$ret_array['addcorefieldname' . $i]] = $data_rows[$ret_array['addcoremapping' . $i]]; } } } else { if (array_key_exists('mapping' . $i, $ret_array)) { if ($ret_array['mapping' . $i] != '-- Select --') { if (array_key_exists($ret_array['mapping' . $i], $data_rows)) { $new_post[$ret_array['fieldname' . $i]] = $data_rows[$ret_array['mapping' . $i]]; } } } } } } } for ($inc = 0; $inc < count($data_rows); $inc++) { foreach ($this->keys as $k => $v) { if (array_key_exists($v, $new_post)) { $custom_array[$v] = $new_post[$v]; } } } if (is_array($new_post)) { foreach ($new_post as $ckey => $cval) { $this->postFlag = true; $taxo = get_taxonomies(); foreach ($taxo as $taxokey => $taxovalue) { if ($taxokey != 'category' && $taxokey != 'link_category' && $taxokey != 'post_tag' && $taxokey != 'nav_menu' && $taxokey != 'post_format') { if ($taxokey == $ckey) { $smack_taxo[$ckey] = $new_post[$ckey]; } } } $taxo_check = 0; if (!isset($smack_taxo[$ckey])) { $smack_taxo[$ckey] = null; $taxo_check = 1; } if ($ckey != 'post_category' && $ckey != 'post_tag' && $ckey != 'featured_image' && $ckey != $smack_taxo[$ckey] && $ckey != 'wp_page_template') { if ($taxo_check == 1) { unset($smack_taxo[$ckey]); $taxo_check = 0; } if (array_key_exists($ckey, $custom_array)) { $darray[$ckey] = $new_post[$ckey]; } else { if (array_key_exists($ckey, $smack_taxo)) { $data_array[$ckey] = null; } else { $data_array[$ckey] = $new_post[$ckey]; } } } else { switch ($ckey) { case 'post_tag': $tags[$ckey] = $new_post[$ckey]; break; case 'post_category': $categories[$ckey] = $new_post[$ckey]; break; case 'wp_page_template': $custom_array['_wp_page_template'] = $new_post[$ckey]; break; case 'featured_image': require_once ABSPATH . "wp-includes/pluggable.php"; require_once ABSPATH . 'wp-admin/includes/image.php'; $dir = wp_upload_dir(); $get_media_settings = get_option('uploads_use_yearmonth_folders'); if ($get_media_settings == 1) { $dirname = date('Y') . '/' . date('m'); $full_path = $dir['basedir'] . '/' . $dirname; $baseurl = $dir['baseurl'] . '/' . $dirname; } else { $full_path = $dir['basedir']; $baseurl = $dir['baseurl']; } $f_img = $new_post[$ckey]; $fimg_path = $full_path; $fimg_name = @basename($f_img); $fimg_name = strtolower(str_replace(' ', '-', $fimg_name)); $fimg_name = preg_replace('/[^a-zA-Z0-9._\\s]/', '', $fimg_name); $fimg_name = urlencode($fimg_name); $parseURL = parse_url($f_img); $path_parts = pathinfo($f_img); if (!isset($path_parts['extension'])) { $fimg_name = $fimg_name . '.jpg'; } $f_img_slug = ''; $f_img_slug = strtolower(str_replace('', '-', $f_img_slug)); $f_img_slug = preg_replace('/[^a-zA-Z0-9._\\s]/', '', $f_img_slug); $post_slug_value = strtolower($f_img_slug); require_once WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . '/includes/WPImporter_includes_helper.php'; $impCE = new WPImporter_includes_helper(); $path_parts['extension'] = isset($path_parts['extension']) ? $path_parts['extension'] : ''; //$fimg_name = wp_unique_filename($fimg_path, $fimg_name, $path_parts['extension']); //$fimg_name = $fimg_name.'.'.$path_parts['extension']; $impCE->get_fimg_from_URL($f_img, $fimg_path, $fimg_name, $post_slug_value, $currentLimit, $this); $filepath = $fimg_path . "/" . $fimg_name; if (@getimagesize($filepath)) { $img = wp_get_image_editor($filepath); $file['guid'] = $baseurl . "/" . $fimg_name; $file['post_title'] = $fimg_name; $file['post_content'] = ''; $file['post_status'] = 'attachment'; } else { $file = false; } break; } } } } if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['selectedImporter'] != 'custompost') { $data_array['post_type'] = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['selectedImporter']; } else { $data_array['post_type'] = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['custompostlist']; } if ($this->titleDupCheck == 'true') { $this->postFlag = $this->duplicateChecks('title', $data_array['post_title'], $data_array['post_type'], $currentLimit, $data_array['post_title']); } if ($this->conDupCheck == 'true' && $this->postFlag) { $this->postFlag = $this->duplicateChecks('content', $data_array['post_content'], $data_array['post_type'], $currentLimit, $data_array['post_title']); } if ($this->titleDupCheck == 'true' && $this->conDupCheck == 'true') { $this->postFlag = $this->duplicateChecks('title && content', $data_array['post_content'], $data_array['post_type'], $currentLimit, $data_array['post_title']); } if ($this->postFlag) { unset($sticky); if (empty($data_array['post_status'])) { $data_array['post_status'] = null; } $data_array['post_type'] = "post"; if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['importallwithps'] != 0) { $data_array['post_status'] = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['importallwithps']; } switch ($data_array['post_status']) { case 1: $data_array['post_status'] = 'publish'; $this->detailedLog[$currentLimit]['poststatus'] = "<b>Status - </b>publish"; break; case 2: $data_array['post_status'] = 'publish'; $sticky = true; $this->detailedLog[$currentLimit]['poststatus'] = "<b>Status - </b>sticky"; break; case 3: $data_array['post_status'] = 'private'; $this->detailedLog[$currentLimit]['poststatus'] = "<b>Status - </b>private"; break; case 4: $data_array['post_status'] = 'draft'; $this->detailedLog[$currentLimit]['poststatus'] = "<b>Status - </b>draft"; break; case 5: $data_array['post_status'] = 'pending'; $this->detailedLog[$currentLimit]['poststatus'] = "<b>Status - </b>pending"; break; default: $poststatus_pwd = $data_array['post_status']; $poststatus = $data_array['post_status'] = strtolower($data_array['post_status']); if ($data_array['post_status'] == 'pending') { $data_array['post_status'] = 'pending'; $this->detailedLog[$currentLimit]['poststatus'] = "<b>" . __('Status', 'wp-ultimate-csv-importer') . " - </b>" . __('pending', 'wp-ultimate-csv-importer'); } if ($data_array['post_status'] == 'draft') { $data_array['post_status'] = 'draft'; $this->detailedLog[$currentLimit]['poststatus'] = "<b>" . __('Status', 'wp-ultimate-csv-importer') . " - </b>" . __('draft', 'wp-ultimate-csv-importer'); } if ($data_array['post_status'] == 'publish') { $data_array['post_status'] = 'publish'; $this->detailedLog[$currentLimit]['poststatus'] = "<b>" . __('Status', 'wp-ultimate-csv-importer') . " - </b>" . __('publish', 'wp-ultimate-csv-importer'); } if ($data_array['post_status'] == 'private') { $data_array['post_status'] = 'private'; $this->detailedLog[$currentLimit]['poststatus'] = "<b>" . __('Status', 'wp-ultimate-csv-importer') . " - </b>" . __('private', 'wp-ultimate-csv-importer'); } if ($data_array['post_status'] != 'publish' && $data_array['post_status'] != 'private' && $data_array['post_status'] != 'draft' && $data_array['post_status'] != 'pending' && $data_array['post_status'] != 'sticky') { $stripPSF = strpos($data_array['post_status'], '{'); if ($stripPSF === 0) { $poststatus = substr($poststatus_pwd, 1); $stripPSL = substr($poststatus, -1); if ($stripPSL == '}') { $postpwd = substr($poststatus, 1, -1); $data_array['post_status'] = 'publish'; $data_array['post_password'] = $postpwd; $this->detailedLog[$currentLimit]['poststatus'] = "<b>" . __('Status', 'wp-ultimate-csv-importer') . " - </b>" . __('protected with password', 'wp-ultimate-csv-importer'); } else { $data_array['post_status'] = 'publish'; $this->detailedLog[$currentLimit]['poststatus'] = "<b>" . __('Status', 'wp-ultimate-csv-importer') . " - </b>" . __('publish', 'wp-ultimate-csv-importer'); } } else { $data_array['post_status'] = 'publish'; $this->detailedLog[$currentLimit]['poststatus'] = "<b>" . __('Status', 'wp-ultimate-csv-importer') . " - </b>" . __('publish', 'wp-ultimate-csv-importer'); } } if ($data_array['post_status'] == 'sticky') { $data_array['post_status'] = 'publish'; $sticky = true; $this->detailedLog[$currentLimit]['poststatus'] = "<b>" . __('Status', 'wp-ultimate-csv-importer') . " - </b>" . __('sticky', 'wp-ultimate-csv-importer'); } /* else { $this->detailedLog[$currentLimit]['poststatus'] = "<b>".__('Status','wp-ultimate-csv-importer')." - </b>" . $data_array['post_status']; }*/ } // Author name/id update if (isset($data_array['post_author'])) { $authorLen = strlen($data_array['post_author']); $postuserid = $data_array['post_author']; $checkpostuserid = intval($data_array['post_author']); $postAuthorLen = strlen($checkpostuserid); $postauthor = array(); if ($authorLen == $postAuthorLen) { $postauthor = $wpdb->get_results("select ID,user_login from {$wpdb->users} where ID = \"{$postuserid}\""); if (empty($postauthor) || !$postauthor[0]->ID) { // If user name are numeric Ex: 1300001 $postauthor = $wpdb->get_results("select ID,user_login from {$wpdb->users} where user_login = \"{$postuserid}\""); } } else { $postauthor = $wpdb->get_results("select ID,user_login from {$wpdb->users} where user_login = \"{$postuserid}\""); } if (empty($postauthor) || !$postauthor[0]->ID) { $data_array['post_author'] = 1; $admindet = $wpdb->get_results("select ID,user_login from {$wpdb->users} where ID = 1"); $this->detailedLog[$currentLimit]['assigned_author'] = "<b>Author - not found (assigned to </b>" . $admindet[0]->user_login . ")"; $this->noPostAuthCount++; } else { $data_array['post_author'] = $postauthor[0]->ID; $this->detailedLog[$currentLimit]['assigned_author'] = "<b>Author - </b>" . $postauthor[0]->user_login; } } else { $data_array['post_author'] = 1; $admindet = $wpdb->get_results("select ID,user_login from {$wpdb->users} where ID = 1"); $this->detailedLog[$currentLimit]['assigned_author'] = "<b>Author - not found (assigned to </b>" . $admindet[0]->user_login . ")"; $this->noPostAuthCount++; } // Date format post if (isset($data_array['post_date'])) { $data_array['post_date'] = str_replace('/', '-', $data_array['post_date']); } else { $data_array['post_date'] = date('Y-m-d'); } if ($data_array['post_date'] == null) { $data_array['post_date'] = date('Y-m-d'); $this->detailedLog[$currentLimit]['postdate'] = "<b>Date - </b>" . $data_array['post_date']; } else { $data_array['post_date'] = date('Y-m-d H:i:s', strtotime($data_array['post_date'])); $this->detailedLog[$currentLimit]['postdate'] = "<b>Date - </b>" . $data_array['post_date']; } if (isset($data_array['post_slug'])) { $data_array['post_name'] = $data_array['post_slug']; } //add global password if ($data_array) { if ($ret_array['importallwithps'] == 3) { $data_array['post_password'] = $ret_array['globalpassword_txt']; $this->detailedLog[$currentLimit]['poststatus'] = "<b>Status - </b>protected with password " . $ret_array['globalpassword_txt']; } } if ($data_array) { if ($this->MultiImages == 'true') { $inlineImagesObj = new WPImporter_inlineImages(); $postid = wp_insert_post($data_array); $post_id = $inlineImagesObj->importwithInlineImages($postid, $currentLimit, $data_array, $this, $importinlineimageoption, $extractedimagelocation, $sample_inlineimage_url); } else { $post_id = wp_insert_post($data_array); $this->detailedLog[$currentLimit]['post_id'] = "<b>Created Post_ID - </b>" . $post_id . " - success"; } } unset($postauthor); if ($post_id) { if (!empty($corecustom_arr)) { foreach ($corecustom_arr as $corecustom_key => $corecustom_value) { update_post_meta($post_id, $corecustom_key, $corecustom_value); } } $custom_array = $this->eshopMetaData($new_post, $post_id, $currentLimit); $uploaded_file_name = $session_arr['uploadedFile']; $real_file_name = $session_arr['uploaded_csv_name']; $action = $data_array['post_type']; $get_imported_feature_image = array(); $get_imported_feature_image = get_option('IMPORTED_FEATURE_IMAGES'); if (is_array($get_imported_feature_image)) { $imported_feature_img = array_merge($get_imported_feature_image, $imported_feature_img); } else { $imported_feature_img = $imported_feature_img; } update_option('IMPORTED_FEATURE_IMAGES', $imported_feature_img); $created_records[$action][] = $post_id; if ($action == 'eshop') { $imported_as = 'eshop-product'; } $keyword = $action; $this->insPostCount++; if (isset($sticky) && $sticky) { stick_post($post_id); } if (!empty($custom_array)) { foreach ($custom_array as $custom_key => $custom_value) { //update_post_meta($post_id, $custom_key, $custom_value); } } //Import SEO Values if (!empty($seo_custom_array)) { $this->importSEOfields($seo_custom_array, $post_id); } // Create custom taxonomy to post if (!empty($smack_taxo)) { foreach ($smack_taxo as $taxo_key => $taxo_value) { if (!empty($taxo_value)) { $split_line = explode('|', $taxo_value); wp_set_object_terms($post_id, $split_line, $taxo_key); } } } // Create/Add tags to post if (!empty($tags)) { $this->detailedLog[$currentLimit]['tags'] = ""; foreach ($tags as $tag_key => $tag_value) { $this->detailedLog[$currentLimit]['tags'] .= $tag_value . "|"; wp_set_post_tags($post_id, $tag_value); } $this->detailedLog[$currentLimit]['tags'] = "<b>Tags - </b>" . substr($this->detailedLog[$currentLimit]['tags'], 0, -1); } // Create/Add category to post if (!empty($categories)) { $this->detailedLog[$currentLimit]['category'] = ""; $assigned_categories = array(); $split_cate = explode('|', $categories['post_category']); foreach ($split_cate as $key => $val) { if (is_numeric($val)) { $split_cate[$key] = 'uncategorized'; $assigned_categories['uncategorized'] = 'uncategorized'; } $assigned_categories[$val] = $val; } foreach ($assigned_categories as $cateKey => $cateVal) { $this->detailedLog[$currentLimit]['category'] .= $cateKey . "|"; } $this->detailedLog[$currentLimit]['category'] = "<b>Category - </b>" . substr($this->detailedLog[$currentLimit]['category'], 0, -1); wp_set_object_terms($post_id, $split_cate, 'category'); } // Add featured image if (!empty($file)) { //$wp_filetype = wp_check_filetype(@basename($file ['guid']), null); $wp_upload_dir = wp_upload_dir(); $attachment = array('guid' => $file['guid'], 'post_mime_type' => 'image/jpeg', 'post_title' => preg_replace('/[^a-zA-Z0-9._\\s]/', '', @basename($file['guid'])), 'post_content' => '', 'post_status' => 'inherit'); if ($get_media_settings == 1) { $generate_attachment = $dirname . '/' . $fimg_name; } else { $generate_attachment = $fimg_name; } $uploadedImage = $wp_upload_dir['path'] . '/' . $fimg_name; $existing_attachment = array(); $query = $wpdb->get_results("select post_title from {$wpdb->posts} where post_type = 'attachment' and post_mime_type = 'image/jpeg'"); foreach ($query as $key) { $existing_attachment[] = $key->post_title; } if (!in_array($fimg_name, $existing_attachment)) { $attach_id = wp_insert_attachment($attachment, $generate_attachment, $post_id); $attach_data = wp_generate_attachment_metadata($attach_id, $uploadedImage); wp_update_attachment_metadata($attach_id, $attach_data); } else { $query2 = $wpdb->get_results("select ID from {$wpdb->posts} where post_title = '{$fimg_name}' and post_type = 'attachment'"); foreach ($query2 as $key2) { $attach_id = $key2->ID; } } set_post_thumbnail($post_id, $attach_id); } } else { $skippedRecords[] = $_SESSION['SMACK_SKIPPED_RECORDS']; } $this->detailedLog[$currentLimit]['verify_here'] = "<b>Verify Here -</b> <a href='" . get_permalink($post_id) . "' title='" . esc_attr(sprintf(__('View “%s”'), $data_array['post_title'])) . "' rel='permalink' target='_blank'>" . __('Web View') . "</a> | <a href='" . get_edit_post_link($post_id, true) . "' title='" . esc_attr(__('Edit this item')) . "' target='_blank'>" . __('Admin View') . "</a>"; } unset($data_array); }
* of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License * version 3, these Appropriate Legal Notices must retain the display of the * WP Ultimate CSV Importer copyright notice. If the display of the logo is * not reasonably feasible for technical reasons, the Appropriate Legal * Notices must display the words * "Copyright Smackcoders. 2015. All rights reserved". ********************************************************************************/ if (!defined('ABSPATH')) { exit; } // Exit if accessed directly global $wp_version, $wpdb; $impCE = new WPImporter_includes_helper(); $nonce_Key = $impCE->create_nonce_key(); if (!wp_verify_nonce($nonce_Key, 'smack_nonce')) { die('You are not allowed to do this operation.Please contact your admin.'); } ?> <div id="ShowMsg" style="display:none;"> <p id="setting-msg" class="alert alert-success"><?php echo __('Settings Saved', 'wp-ultimate-csv-importer'); ?> </p> </div> <?php $wpcsvfreesettings = get_option('wpcsvfreesettings'); $debugmode = isset($wpcsvfreesettings['debug_mode']) ? $wpcsvfreesettings['debug_mode'] : ''; $allow_import = isset($wpcsvfreesettings['enable_plugin_access_for_author']) ? $wpcsvfreesettings['enable_plugin_access_for_author'] : ''; global $wpdb;
$requested_limit = intval($_POST['postdata']['importlimit']); $tmpCnt = intval($_POST['postdata']['tmpcount']); if ($count <= $totRecords) { $count = $tmpCnt + $count; if ($count > $totRecords) { $count = $totRecords; } } else { $count = $totRecords; } $resultArr = array(); $res2 = array(); $res1 = array(); $get_mapped_array = array(); $mapping_value = ''; $import_obj = new WPImporter_includes_helper(); $filename = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['uploadedFile']; $parserObj = new SmackCSVParser(); $file = $import_obj->getUploadDirectory() . '/' . $filename; $resultArr = $parserObj->parseCSV($file, $limit, $get_request_limit); if (sanitize_text_field($_POST['postdata']['dupTitle'])) { $importObj->titleDupCheck = sanitize_text_field($_POST['postdata']['dupTitle']); } if (sanitize_text_field($_POST['postdata']['dupContent'])) { $importObj->conDupCheck = sanitize_text_field($_POST['postdata']['dupContent']); } $csv_rec_count = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['h2']; $available_groups = $skinnyObj->get_availgroups($curr_action); //mapped and unmapped count if (!empty($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']) && is_array($_SESSION['SMACK_MAPPING_SETTINGS_VALUES'])) { foreach ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES'] as $seskey => $sesval) {
/** * The actions index method * @param array $request * @return array */ public function executeIndex($request) { // return an array of name value pairs to send data to the template $data = array(); $data['savesettings'] = 'notdone'; if (isset($_POST['savesettings'])) { update_option('wpcsvfreesettings', $_POST); $data['savesettings'] = 'done'; //echo "<script> location.reload(); </script>"; } $setingsArr = array('post', 'page', 'custompost', 'comments', 'categories', 'customtaxonomy', 'users', 'eshop', 'wpcommerce', 'woocommerce', 'custompostuitype', 'cctm', 'acf', 'aioseo', 'yoastseo', 'enable', 'disable', 'nonerseooption', 'nonercustompost', 'nonerecommerce', 'recommerce', 'enable_plugin_access_for_author', 'send_log_email', 'enable_debug', 'disable_debug', 'debug_mode'); foreach ($setingsArr as $option) { $data[$option] = ""; } $skinnycontroller = new WPImporter_includes_helper(); $settings = $skinnycontroller->getSettings(); foreach ($settings as $settings_key) { $data[$settings_key] = 'checked'; } //Settings action //SEO option $tableseo = get_option('wpcsvfreesettings'); $seooption = isset($tableseo['rseooption']) ? $tableseo['rseooption'] : ''; if ($seooption == 'aioseo') { $data['aioseo'] = 'checked enablesetting'; $data['yoastseo'] = 'disablesetting'; $data['nonerseooption'] = 'disablesetting'; $data['aioseo_status'] = 'Enabled'; $data['yoastseo_status'] = 'Disabled'; $data['none_status'] = 'Disabled'; } else { if ($seooption == 'yoastseo') { $data['yoastseo'] = 'checked enablesetting'; $data['aioseo'] = 'disablesetting'; $data['nonerseooption'] = 'disablesetting'; $data['aioseo_status'] = 'Disabled'; $data['yoastseo_status'] = 'Enabled'; $data['none_status'] = 'Disabled'; } else { $data['nonerseooption'] = 'checked enablesetting'; $data['aioseo'] = 'disablesetting'; $data['yoastseo'] = 'disablesetting'; $data['aioseo_status'] = 'Disabled'; $data['yoastseo_status'] = 'Disabled'; $data['none_status'] = 'Enabled'; } } $data['wpcustomfields'] = ''; if (isset($tableseo['wpcustomfields']) && $tableseo['wpcustomfields'] == 'on') { $data['wpcustomfields'] = 'checked'; } //Security and Performance if (isset($tableseo['enable_plugin_access_for_author'])) { $importoption = $tableseo['enable_plugin_access_for_author']; } else { $importoption = ''; } if ($importoption == 'enable_plugin_access_for_author') { $data['authorimport'] = 'checked enablesetting'; $data['noauthorimport'] = 'disablesetting'; } else { $data['noauthorimport'] = 'checked enablesetting'; $data['authorimport'] = 'disablesetting'; } //General Settings if (isset($tableseo['post'])) { $importoption = $tableseo['post']; } else { $importoption = ''; } if ($importoption == 'post') { $data['post'] = 'checked enablesetting'; $data['nopost'] = 'disablesetting'; } else { $data['nopost'] = 'checked enablesetting'; $data['post'] = 'disablesetting'; } if (isset($tableseo['page'])) { $importoption = $tableseo['page']; } else { $importoption = ''; } if ($importoption == 'page') { $data['page'] = 'checked enablesetting'; $data['nopage'] = 'disablesetting'; } else { $data['nopage'] = 'checked enablesetting'; $data['page'] = 'disablesetting'; } if (isset($tableseo['users'])) { $importoption = $tableseo['users']; } else { $importoption = ''; } if ($importoption == 'users') { $data['users'] = 'checked enablesetting'; $data['nousers'] = 'disablesetting'; } else { $data['nousers'] = 'checked enablesetting'; $data['users'] = 'disablesetting'; } if (isset($tableseo['comments'])) { $importoption = $tableseo['comments']; } else { $importoption = ''; } if ($importoption == 'comments') { $data['comments'] = 'checked enablesetting'; $data['nocomments'] = 'disablesetting'; } else { $data['nocomments'] = 'checked enablesetting'; $data['comments'] = 'disablesetting'; } if (isset($tableseo['custompost'])) { $importoption = $tableseo['custompost']; } else { $importoption = ''; } if ($importoption == 'custompost') { $data['custompost'] = 'checked enablesetting'; $data['nocustompost'] = 'disablesetting'; } else { $data['nocustompost'] = 'checked enablesetting'; $data['custompost'] = 'disablesetting'; } if (isset($tableseo['customtaxonomy'])) { $importoption = $tableseo['customtaxonomy']; } else { $importoption = ''; } if ($importoption == 'customtaxonomy') { $data['customtaxonomy'] = 'checked enablesetting'; $data['nocustomtaxonomy'] = 'disablesetting'; } else { $data['nocustomtaxonomy'] = 'checked enablesetting'; $data['customtaxonomy'] = 'disablesetting'; } if (isset($tableseo['categories'])) { $importoption = $tableseo['categories']; } else { $importoption = ''; } if ($importoption == 'categories') { $data['categories'] = 'checked enablesetting'; $data['nocategories'] = 'disablesetting'; } else { $data['nocategories'] = 'checked enablesetting'; $data['categories'] = 'disablesetting'; } if (isset($tableseo['rcustomerreviews'])) { $importoption = $tableseo['rcustomerreviews']; } else { $importoption = ''; } if ($importoption == 'customerreviews') { $data['customerreviews'] = 'checked enablesetting'; $data['nocustomerreviews'] = 'disablesetting'; } else { $data['nocustomerreviews'] = 'checked enablesetting'; $data['customerreviews'] = 'disablesetting'; } // Debug mode enable / disable if (isset($tableseo['debug_mode'])) { $debug_mode = $tableseo['debug_mode']; } else { $debug_mode = ''; } if ($debug_mode == 'enable_debug') { $data['debugmode_enable'] = 'checked enablesetting'; $data['debugmode_disable'] = 'disablesetting'; } else { if ($debug_mode == 'disable_debug') { $data['debugmode_enable'] = 'disablesetting'; $data['debugmode_disable'] = 'checked enablesetting'; } } //Custom Fields #$wpmemberoption = $tableseo['rwpmembers']; if (isset($tableseo['rwpmembers']) && $tableseo['rwpmembers'] == 'wpmembers') { $data['checkuser'] = '******'; $data['uncheckuser'] = '******'; } else { $data['uncheckuser'] = '******'; $data['checkuser'] = '******'; } #$customfieldoption = $tableseo['rcustomfield']; if (isset($tableseo['rcustomfield']) && $tableseo['rcustomfield'] == 'acf') { $data['acf'] = 'checked enablesetting'; $data['cctmcustfields'] = 'disablesetting'; $data['wptypescustfields'] = 'disablesetting'; $data['podscustomfields'] = 'disablesetting'; $data['acf_status'] = 'Enabled'; $data['cctmfield_status'] = 'Disabled'; $data['typesfield_status'] = 'Disabled'; $data['podsfield_status'] = 'Disabled'; } else { if (isset($tableseo['rcustomfield']) && $tableseo['rcustomfield'] == 'cctmcustfields') { $data['cctmcustfields'] = 'checked enablesetting'; $data['acf'] = 'disablesetting'; $data['wptypescustfields'] = 'disablesetting'; $data['podscustomfields'] = 'disablesetting'; $data['acf_status'] = 'Disabled'; $data['cctmfield_status'] = 'Enabled'; $data['typesfield_status'] = 'Disabled'; $data['podsfield_status'] = 'Disabled'; } else { if (isset($tableseo['rcustomfield']) && $tableseo['rcustomfield'] == 'wptypescustfields') { $data['wptypescustfields'] = 'checked enablesetting'; $data['acf'] = 'disablesetting'; $data['cctmcustfields'] = 'disablesetting'; $data['podscustomfields'] = 'disablesetting'; $data['acf_status'] = 'Disabled'; $data['cctmfield_status'] = 'Disabled'; $data['typesfield_status'] = 'Enabled'; $data['podsfield_status'] = 'Disabled'; } else { if (isset($tableseo['rcustomfield']) && $tableseo['rcustomfield'] == 'podscustomfields') { $data['podscustomfields'] = 'checked enablesetting'; $data['acf'] = 'disablesetting'; $data['cctmcustfields'] = 'disablesetting'; $data['wptypescustfields'] = 'disablesetting'; $data['acf_status'] = 'Disabled'; $data['cctmfield_status'] = 'Disabled'; $data['typesfield_status'] = 'Disabled'; $data['podsfield_status'] = 'Enabled'; } else { $data['podscustomfields'] = 'disablesetting'; $data['acf'] = 'disablesetting'; $data['cctmcustfields'] = 'disablesetting'; $data['wptypescustfields'] = 'disablesetting'; $data['acf_status'] = 'Disabled'; $data['cctmfield_status'] = 'Disabled'; $data['typesfield_status'] = 'Disabled'; $data['podsfield_status'] = 'Disabled'; } } } } //Custom post $tablecustompost = get_option('wpcsvfreesettings'); $customoption = isset($tablecustompost['rcustompost']) ? $tablecustompost['rcustompost'] : ''; if ($customoption == 'custompostuitype') { $data['custompostuitype'] = 'checked enablesetting'; $data['wptypes'] = 'disablesetting'; $data['cctm'] = 'disablesetting'; $data['podspost'] = 'disablesetting'; $data['nonercustompost'] = 'disablesetting'; $data['default_status'] = 'Disabled'; $data['cptui_status'] = 'Enabled'; $data['wptypes_status'] = 'Disabled'; $data['cctm_status'] = 'Disabled'; $data['podspost_status'] = 'Disabled'; } else { if ($customoption == 'wptypes') { $data['wptypes'] = 'checked enablesetting'; $data['custompostuitype'] = 'disablesetting'; $data['cctm'] = 'disablesetting'; $data['podspost'] = 'disablesetting'; $data['nonercustompost'] = 'disablesetting'; $data['default_status'] = 'Disabled'; $data['cptui_status'] = 'Disabled'; $data['wptypes_status'] = 'Enabled'; $data['cctm_status'] = 'Disabled'; $data['podspost_status'] = 'Disabled'; } else { if ($customoption == 'cctm') { $data['cctm'] = 'checked enablesetting'; $data['wptypes'] = 'disablesetting'; $data['custompostuitype'] = 'disablesetting'; $data['podspost'] = 'disablesetting'; $data['nonercustompost'] = 'disablesetting'; $data['default_status'] = 'Disabled'; $data['cptui_status'] = 'Disabled'; $data['wptypes_status'] = 'Disabled'; $data['cctm_status'] = 'Enabled'; $data['podspost_status'] = 'Disabled'; } else { if ($customoption == 'podspost') { $data['podspost'] = 'checked enablesetting'; $data['cctm'] = 'disablesetting'; $data['wptypes'] = 'disablesetting'; $data['custompostuitype'] = 'disablesetting'; $data['nonercustompost'] = 'disablesetting'; $data['default_status'] = 'Disabled'; $data['cctm_status'] = 'Disabled'; $data['cptui_status'] = 'Disabled'; $data['wptypes_status'] = 'Disabled'; $data['podspost_status'] = 'Enabled'; } else { $data['nonercustompost'] = 'checked enablesetting'; $data['cctm'] = 'disablesetting'; $data['wptypes'] = 'disablesetting'; $data['podspost'] = 'disablesetting'; $data['custompostuitype'] = 'disablesetting'; $data['default_status'] = 'Enabled'; $data['cptui_status'] = 'Disabled'; $data['wptypes_status'] = 'Disabled'; $data['cctm_status'] = 'Disabled'; $data['podspost_status'] = 'Disabled'; } } } } //Additional Settings $scheduleoption = isset($tableseo['send_log_email']) ? $tableseo['send_log_email'] : ''; if ($scheduleoption == 'send_log_email') { $data['schedulelog'] = 'checked enablesetting'; $data['schedulenolog'] = 'disablesetting'; } else { $data['schedulenolog'] = 'checked enablesetting'; $data['schedulelog'] = 'disablesetting'; } $categoryoption = isset($tableseo['rcateicons']) ? $tableseo['rcateicons'] : ''; if ($categoryoption == 'enable') { $data['catyenable'] = 'checked enablesetting'; $data['catydisable'] = 'disablesetting'; $data['catyenablestatus'] = 'checked'; $data['catydisablestatus'] = ''; } else { $data['catydisable'] = 'checked enablesetting'; $data['catyenable'] = 'disablesetting'; $data['catyenablestatus'] = ''; $data['catydisablestatus'] = 'checked'; } $dropoption = $tableseo['drop_table']; if ($dropoption == 'on') { $data['drop_on'] = 'checked enablesetting'; $data['drop_off'] = 'disablesetting'; $data['dropon_status'] = 'checked'; $data['dropoff_status'] = ''; } else { $data['drop_off'] = 'checked enablesetting'; $data['drop_on'] = 'disablesetting'; $data['dropon_status'] = ''; $data['dropoff_status'] = 'checked'; } //Eccommerce option $ecommerceoption = isset($tableseo['recommerce']) ? $tableseo['recommerce'] : ''; if ($ecommerceoption == 'eshop') { $data['eshop'] = 'checked enablesetting'; $data['marketpress'] = 'disablesetting'; $data['woocommerce'] = 'disablesetting'; $data['wpcommerce'] = 'disablesetting'; $data['nonerecommerce'] = 'disablesetting'; $data['eshop_status'] = 'Enabled'; $data['marketpress_status'] = 'Disabled'; $data['woocommerce_status'] = 'Disabled'; $data['wpcommerce_status'] = 'Disabled'; $data['ecomnone_status'] = 'Disabled'; } else { if ($ecommerceoption == 'marketpress') { $data['marketpress'] = 'checked enablesetting'; $data['eshop'] = 'disablesetting'; $data['woocommerce'] = 'disablesetting'; $data['wpcommerce'] = 'disablesetting'; $data['nonerecommerce'] = 'disablesetting'; $data['eshop_status'] = 'Disabled'; $data['marketpress_status'] = 'Enabled'; $data['woocommerce_status'] = 'Disabled'; $data['wpcommerce_status'] = 'Disabled'; $data['ecomnone_status'] = 'Disabled'; } else { if ($ecommerceoption == 'woocommerce') { $data['woocommerce'] = 'checked enablesetting'; $data['marketpress'] = 'disablesetting'; $data['eshop'] = 'disablesetting'; $data['wpcommerce'] = 'disablesetting'; $data['nonerecommerce'] = 'disablesetting'; $data['eshop_status'] = 'Disabled'; $data['marketpress_status'] = 'Disabled'; $data['woocommerce_status'] = 'Enabled'; $data['wpcommerce_status'] = 'Disabled'; $data['ecomnone_status'] = 'Disabled'; } else { if ($ecommerceoption == 'wpcommerce') { $data['wpcommerce'] = 'checked enablesetting'; $data['marketpress'] = 'disablesetting'; $data['woocommerce'] = 'disablesetting'; $data['eshop'] = 'disablesetting'; $data['nonerecommerce'] = 'disablesetting'; $data['eshop_status'] = 'Disabled'; $data['marketpress_status'] = 'Disabled'; $data['woocommerce_status'] = 'Disabled'; $data['wpcommerce_status'] = 'Enabled'; $data['ecomnone_status'] = 'Disabled'; } else { $data['nonerecommerce'] = 'checked enablesetting'; $data['wpcommerce'] = 'disablesetting'; $data['marketpress'] = 'disablesetting'; $data['woocommerce'] = 'disablesetting'; $data['eshop'] = 'disablesetting'; $data['eshop_status'] = 'Disabled'; $data['marketpress_status'] = 'Disabled'; $data['woocommerce_status'] = 'Disabled'; $data['wpcommerce_status'] = 'Disabled'; $data['ecomnone_status'] = 'Enabled'; } } } } $data['cctmtd'] = $this->getpluginstate('custom-content-type-manager/index.php'); $data['cptutd'] = $this->getpluginstate('custom-post-type-ui/custom-post-type-ui.php'); $data['eshoptd'] = $this->getpluginstate('eshop/eshop.php'); $data['wpcomtd'] = $this->getpluginstate('wp-e-commerce/wp-shopping-cart.php'); $data['woocomtd'] = $this->getpluginstate('woocommerce/woocommerce.php'); $data['aioseotd'] = $this->getpluginstate('all-in-one-seo-pack/all_in_one_seo_pack.php'); $data['yoasttd'] = $this->getpluginstate('wordpress-seo/wp-seo.php'); $data['cateicontd'] = $this->getpluginstate('category-icons/category_icons.php'); $data['wecftd'] = $this->getpluginstate('wp-e-commerce-custom-fields/custom-fields.php'); $data['acftd'] = $this->getpluginstate('advanced-custom-fields/acf.php'); $data['cctmtdi'] = $this->getpluginstate('custom-content-type-manager/index.php'); $data['cptutdi'] = $this->getpluginstate('custom-post-type-ui/custom-post-type-ui.php'); $data['eshoptdi'] = $this->getpluginstate('eshop/eshop.php'); $data['wpcomtdi'] = $this->getpluginstate('wp-e-commerce/wp-shopping-cart.php'); $data['woocomtdi'] = $this->getpluginstate('woocommerce/woocommerce.php'); $data['aioseotdi'] = $this->getpluginstate('all-in-one-seo-pack/all_in_one_seo_pack.php'); $data['yoasttdi'] = $this->getpluginstate('wordpress-seo/wp-seo.php'); $data['cateicontdi'] = $this->getpluginstate('category-icons/category_icons.php'); $data['acftdi'] = $this->getpluginstate('advanced-custom-fields/acf.php'); $data['plugStatus'] = $this->allPluginStatus($data); return $data; }
function linetwoStats() { global $wpdb; ob_flush(); $myObj = new WPImporter_includes_helper(); $content = "<form name='piechart'> <div id ='ultimatecsv_lineStats' style='height:250px'>"; $myObj->getStatsWithDate(); $content .= "</div></form>"; echo $content; }
* * You can contact Smackcoders at email address info@smackcoders.com. * * The interactive user interfaces in original and modified versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License * version 3, these Appropriate Legal Notices must retain the display of the * WP Ultimate CSV Importer copyright notice. If the display of the logo is * not reasonably feasible for technical reasons, the Appropriate Legal * Notices must display the words * "Copyright Smackcoders. 2015. All rights reserved". ********************************************************************************/ if (!defined('ABSPATH')) { exit; } // Exit if accessed directly global $wpdb; $dashObj = new WPImporter_includes_helper(); if (sanitize_text_field($_REQUEST['postdata']) == 'firstchartdata') { require_once WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . 'lib/skinnymvc/core/base/SkinnyBaseActions.php'; require_once WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . 'lib/skinnymvc/core/SkinnyActions.php'; require_once 'actions.php'; echo json_encode($dashObj->piechart()); } elseif (sanitize_text_field($_REQUEST['postdata']) == 'secondchartdata') { require_once WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . 'lib/skinnymvc/core/base/SkinnyBaseActions.php'; require_once WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . 'lib/skinnymvc/core/SkinnyActions.php'; require_once 'actions.php'; echo json_encode($dashObj->getStatsWithDate()); }
function action_csv_imp_admin_menu() { if (!function_exists('wp_get_current_user')) { include ABSPATH . "wp-includes/pluggable.php"; } if (is_multisite()) { if (current_user_can('administrator')) { add_menu_page(WP_CONST_ULTIMATE_CSV_IMP_SETTINGS, WP_CONST_ULTIMATE_CSV_IMP_NAME, 'manage_options', __FILE__, array('WPImporter_includes_helper', 'output_fd_page'), WP_CONST_ULTIMATE_CSV_IMP_DIR . "images/icon.png"); } else { if (current_user_can('author') || current_user_can('editor')) { $HelperObj = new WPImporter_includes_helper(); $settings = $HelperObj->getSettings(); if (isset($settings['enable_plugin_access_for_author']) && $settings['enable_plugin_access_for_author'] == 'enable_plugin_access_for_author') { add_menu_page(WP_CONST_ULTIMATE_CSV_IMP_SETTINGS, WP_CONST_ULTIMATE_CSV_IMP_NAME, '2', __FILE__, array('WPImporter_includes_helper', 'output_fd_page'), WP_CONST_ULTIMATE_CSV_IMP_DIR . "images/icon.png"); } } } } else { if (current_user_can('administrator')) { add_menu_page(WP_CONST_ULTIMATE_CSV_IMP_SETTINGS, WP_CONST_ULTIMATE_CSV_IMP_NAME, 'manage_options', __FILE__, array('WPImporter_includes_helper', 'output_fd_page'), WP_CONST_ULTIMATE_CSV_IMP_DIR . "images/icon.png"); } else { if (current_user_can('author') || current_user_can('editor')) { $HelperObj = new WPImporter_includes_helper(); $settings = $HelperObj->getSettings(); if (isset($settings['enable_plugin_access_for_author']) && $settings['enable_plugin_access_for_author'] == 'enable_plugin_access_for_author') { add_menu_page(WP_CONST_ULTIMATE_CSV_IMP_SETTINGS, WP_CONST_ULTIMATE_CSV_IMP_NAME, '2', __FILE__, array('WPImporter_includes_helper', 'output_fd_page'), WP_CONST_ULTIMATE_CSV_IMP_DIR . "images/icon.png"); } } } /*else if ( current_user_can( 'administrator' ) ) { add_menu_page(WP_CONST_ULTIMATE_CSV_IMP_SETTINGS, WP_CONST_ULTIMATE_CSV_IMP_NAME, 'manage_options', __FILE__, array('WPImporter_includes_helper', 'output_fd_page'), WP_CONST_ULTIMATE_CSV_IMP_DIR . "images/icon.png"); }*/ } }
* of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License * version 3, these Appropriate Legal Notices must retain the display of the * WP Ultimate CSV Importer copyright notice. If the display of the logo is * not reasonably feasible for technical reasons, the Appropriate Legal * Notices must display the words * "Copyright Smackcoders. 2014. All rights reserved". ********************************************************************************/ if (!defined('ABSPATH')) { exit; } // Exit if accessed directly global $wpdb; $impCE = new WPImporter_includes_helper(); $dashObj = new DashboardActions(); $ret_arr = array(); #if(isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'filenotfound'){ ?> <!--<script> showMapMessages('error',translateAlertString('The files does not exist')); </script>--> <?php #} ?> <div class="box-one"> <div class="top-right-box"> <h3><span style="margin: -5px 5px 5px 5px;"><img src="<?php echo WP_CONST_ULTIMATE_CSV_IMP_DIR; ?>
* of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License * version 3, these Appropriate Legal Notices must retain the display of the * WP Ultimate CSV Importer copyright notice. If the display of the logo is * not reasonably feasible for technical reasons, the Appropriate Legal * Notices must display the words * "Copyright Smackcoders. 2014. All rights reserved". ********************************************************************************/ if (!defined('ABSPATH')) { exit; } // Exit if accessed directly global $wp_version, $wpdb; $impCE = new WPImporter_includes_helper(); $nonce_Key = $impCE->create_nonce_key(); if (!wp_verify_nonce($nonce_Key, 'smack_nonce')) { die('You are not allowed to do this operation.Please contact your admin.'); } ?> <div style ='text-align:center;margin:0;color:red;font-size:smaller;'> <?php echo __('Your Required Settings Configuration Please Select Security and Performance tab', 'wp-ultimate-csv-importer'); ?> </div></br> <div id="ShowMsg" style="display:none;"><p id="warning-msg" class="alert alert-warning"><?php echo $skinnyData['plugStatus']; ?> </p></div> <?php if (isset($skinnyData['savesettings']) && $skinnyData['savesettings'] == 'done') {