PluginProbe
Export All Posts, Products, Orders & Users | WP Ultimate Exporter | WordPress CSV Export / 2.12
Export All Posts, Products, Orders & Users | WP Ultimate Exporter | WordPress CSV Export v2.12
3.0 2.24.2 2.24.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 2.0 2.0.1 2.1 2.1.1 2.1.2 2.10 2.11 2.12 2.13 2.14 2.15 2.16 2.16.1 2.16.2 All 96 releases
wp-ultimate-exporter / wp-ultimate-exporter.php

wp-ultimate-exporter.php in Export All Posts, Products, Orders & Users | WP Ultimate Exporter | WordPress CSV Export 2.12, at wp-ultimate-exporter.php

208 lines 7.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * WP Ultimate Exporter.
4 *
5 * WP Ultimate Exporter plugin file.
6 *
7 * @package Smackcoders\SMEXP
8 * @copyright Copyright (C) 2010-2020, Smackcoders Inc - info@smackcoders.com
9 * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License, version 3 or higher
10 *
11 * @wordpress-plugin
12 * Plugin Name: WP Ultimate Exporter
13 * Version: 2.12
14 * Plugin URI: https://www.smackcoders.com/ultimate-exporter.html
15 * Description: Backup tool to export all your WordPress data as CSV file. eCommerce data of WooCommerce, eCommerce, Custom Post and Custom field information along with default WordPress modules.
16 * Author: Smackcoders
17 * Author URI: https://www.smackcoders.com/wordpress.html
18 * Text Domain: wp-ultimate-exporter
19 * Domain Path: /languages
20 * License: GPL v3
21 *
22 * This program is free software: you can redistribute it and/or modify
23 * it under the terms of the GNU General Public License as published by
24 * the Free Software Foundation, either version 3 of the License, or
25 * (at your option) any later version.
26 *
27 * This program is distributed in the hope that it will be useful,
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 * GNU General Public License for more details.
31 *
32 * You should have received a copy of the GNU General Public License
33 * along with this program. If not, see <https://www.gnu.org/licenses/>.
34 */
35
36 namespace Smackcoders\SMEXP;
37
38 if ( ! defined( 'ABSPATH' ) )
39 exit; // Exit if accessed directly
40
41 define('IMPORTER_VERSION', '7.17');
42 define('EXPORTER_VERSION', '2.12');
43 require_once('Plugin.php');
44 require_once('SmackExporterInstall.php');
45 require_once('exportExtensions/ExportExtension.php');
46 require_once('exportExtensions/JetBookingExport.php');
47 require_once('exportExtensions/JetReviewsExport.php');
48
49
50 if ( ! function_exists( 'is_plugin_active' ) ) {
51 require_once ABSPATH . 'wp-admin/includes/plugin.php';
52 }
53 $upload = wp_upload_dir();
54 $exports_dir = $upload['basedir'] . '/smack_uci_uploads/exports/';
55 $htaccess_file = $exports_dir . '.htaccess';
56 if (file_exists($htaccess_file)) {
57 unlink($htaccess_file);
58 }
59 if (is_plugin_active('wp-ultimate-exporter/wp-ultimate-exporter.php')) {
60 $plugin_pages = ['com.smackcoders.csvimporternew.menu'];
61 include __DIR__ . '/wp-exp-hooks.php';
62 global $plugin_ajax_hooks;
63
64 $request_page = isset($_REQUEST['page']) ? $_REQUEST['page'] : '';
65 $request_action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
66 if (in_array($request_page, $plugin_pages) || in_array($request_action, $plugin_ajax_hooks)) {
67 require_once('exportExtensions/JetEngine.php');
68 require_once('exportExtensions/LearnPress.php');
69 require_once('exportExtensions/MetaBox.php');
70 require_once('exportExtensions/ExportHandler.php');
71 require_once('exportExtensions/CustomerReviewsExport.php');
72 require_once('exportExtensions/PostExport.php');
73 require_once('exportExtensions/WooComExport.php');
74
75 }
76 }
77
78 if(! class_exists('Smackcoders\SMEXP\ExportExtension')){
79 ExpInstall::init(plugin_basename( __FILE__ ));
80 add_action( 'admin_notices', 'Smackcoders\\SMEXP\\Notice_msg_exporter_free' );
81 }
82 else {
83 class ExpCSVHandler extends ExportExtension{
84
85 protected static $instance = null,$install,$exp_instance;
86
87 public function __construct(){
88 $this->plugin = Plugin::getInstance();
89 add_action('wp_ajax_get_plugin_notice', array($this,'check_parent_plugin_version'));
90 // add_action('wp_ajax_upgrade_notices_csv_bro',array($this,'dismiss_function'));
91 add_action('wp_ajax_upgrade_notices_csv_bro', array($this,'dismiss_function'));
92 add_action('wp_ajax_nopriv_upgrade_notices_csv_bro', array($this,'dismiss_function'));
93 add_action('wp_ajax_dismiss_notice',array($this,'dismiss_function_new'));
94 }
95
96 public function dismiss_function_new() {
97 update_option('csv_update_option', 0);
98 exit();
99 }
100
101 public function dismiss_function() {
102 update_option('csv_update_option', 0);
103 $response =array();
104 $response['value'] = 0;
105 echo wp_json_encode($response);
106 wp_die();
107 // exit();
108 }
109 function check_parent_plugin_version() {
110 $parent_plugin_dir = WP_PLUGIN_DIR . '/wp-ultimate-csv-importer/wp-ultimate-csv-importer.php';
111 $parent_plugin_data = get_plugin_data($parent_plugin_dir);
112 $parent_version=$parent_plugin_data['Version'];
113
114 $child_plugin_dir = WP_PLUGIN_DIR . '/wp-ultimate-exporter/wp-ultimate-exporter.php';
115 $child_plugin_data = get_plugin_data($child_plugin_dir);
116 $child_version=$child_plugin_data['Version'];
117 // if($parent_version < IMPORTER_VERSION || $child_version < EXPORTER_VERSION ){
118 if(version_compare($parent_version, IMPORTER_VERSION, '<') || version_compare($child_version,EXPORTER_VERSION, '<')){
119 $option_name = 'csv_update_option';
120 $option_value = 1;
121 $autoload = true;
122 if (get_option($option_name) === false) {
123 add_option($option_name, $option_value, '', $autoload);
124 }
125 if(get_option('csv_update_option') == 1){
126 $response=array();
127 $response['message'] ='Important note: Please upgrade latest versions for security updates.';
128 $response['link'] = admin_url('plugins.php');
129 $response['value'] = 1;
130 $response['dismiss'] = 'Dismiss this notice.';
131 $response['upgrade'] = 'Upgrade Now';
132 echo wp_json_encode($response);
133 wp_die();
134 ?>
135 <!-- <div class="notice notice-info is-dismissible">
136 <p><?php//_e('Important note: Please upgrade your WP Ultimate CSV Importer to latest versions for security updates.', 'wp-ultimate-exporter'); ?></p>
137 <p><a href="<?php //echo admin_url('plugins.php'); ?>" class="button"><?php //_e('Upgrade Now', 'wp-ultimate-exporter'); ?></a></p>
138 <button type="submit"class="notice-dismiss" id="upgrade_notices_csv_bro">
139 <span class="screen-reader-text">Dismiss this notice.</span>
140 </button>
141 </div> -->
142 <?php
143 }
144 }
145 }
146 // public static function is_upgrade_notice_dismissed() {
147 // return get_option('csv_update_option', false);
148 // }
149 public static function getInstance() {
150 if (ExpCSVHandler::$instance == null) {
151 ExpCSVHandler::$instance = new ExpCSVHandler;
152 ExpCSVHandler::$install = ExpInstall::getInstance();
153 ExpCSVHandler::$exp_instance = ExportExtension::getInstance();
154
155 return ExpCSVHandler::$instance;
156 }
157 return ExpCSVHandler::$instance;
158 }
159 /**
160 * Init UserSmCSVHandlerPro when WordPress Initialises.
161 */
162 public function init() {
163 if(is_admin()) {
164 // Init action.
165 do_action('uci_init');
166 }
167 }
168 }
169 }
170
171 add_action( 'plugins_loaded', 'Smackcoders\\SMEXP\\onpluginsload' );
172
173
174 function onpluginsload(){
175 $plugin_pages = ['com.smackcoders.csvimporternew.menu'];
176 include __DIR__ . '/wp-exp-hooks.php';
177 global $plugin_ajax_hooks;
178
179 $request_page = isset($_REQUEST['page']) ? $_REQUEST['page'] : '';
180 $request_action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
181 if (in_array($request_page, $plugin_pages) || in_array($request_action, $plugin_ajax_hooks)) {
182 $plugin = ExpCSVHandler::getInstance();
183 }
184 $upload = wp_upload_dir();
185 $upload_dir = $upload['basedir'];
186 // if(!is_dir($upload_dir)){
187 // return false;
188 // }
189 // else{
190 // $exports_dir = $upload['basedir'] . '/smack_uci_uploads/exports/';
191 // $htaccess_content = "deny from all\n";
192 // $htaccess_file = $exports_dir . '.htaccess';
193 // if (!file_exists($htaccess_file)) {
194 // file_put_contents($htaccess_file, $htaccess_content);
195 // }
196 // }
197 }
198
199 function Notice_msg_exporter_free() {
200
201 ?>
202 <div class="notice notice-warning is-dismissible" >
203 <p> WP Ultimate Exporter is an addon of <a href="https://wordpress.org/plugins/wp-ultimate-csv-importer" target="blank" style="cursor: pointer;text-decoration:none">WP Ultimate CSV Importer</a> plugin, kindly install it to continue using WP ultimate exporter. </p>
204 </div>
205 <?php
206
207 }?>
208