PluginProbe ʕ •ᴥ•ʔ
WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets / 3.9.4
WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets v3.9.4
3.9.5 3.9.6 4.0.0 4.0.1 4.1.0 trunk 2.12 2.13 2.14 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 3.4.9 3.5.0 3.5.1 3.5.2 3.5.3 3.5.4 3.5.5 3.5.6 3.5.7 3.5.8 3.5.9 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.6.9 3.7.0 3.7.1 3.7.2 3.7.3 3.7.3-beta-1.0 3.7.4 3.7.4-beta-1.0 3.7.5 3.7.6 3.7.7 3.7.8 3.7.9 3.8.0 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4
wp-all-import / classes / error.php
wp-all-import / classes Last commit date
XmlStreamReader 2 years ago partner-discount-sdk 1 year ago api.php 4 years ago arraytoxml.php 8 years ago chunk.php 1 year ago config.php 2 years ago download.php 13 years ago error.php 2 years ago handler.php 9 months ago helper.php 8 years ago input.php 7 years ago nested.php 4 years ago rapidaddon.php 9 months ago render.php 4 years ago session.php 9 months ago upload.php 9 months ago zip.php 10 years ago
error.php
83 lines
1 <?php
2
3 class PMXI_Error{
4
5 public $recordNumber;
6
7 public function __construct($recordNumber = false) {
8 $this->recordNumber = $recordNumber;
9 }
10
11 public function handle(){
12
13 $error = $this->getLastError();
14 $trace = $this->trace();
15 if($error && strpos($error['file'], 'functions.php') !== false){
16 $wp_uploads = $this->getUploadsDir();
17 $functions = 'in '.$wp_uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'functions.php:'.$error['line'];
18 $error['message'] = str_replace($functions, '', $error['message']);
19 $error['message'] = str_replace("\\n",'',$error['message']);
20 $errorParts = explode('Stack trace', $error['message']);
21 $error['message'] = $errorParts[0];
22 $error['message'] .=' on line '.$error['line'];
23 $error['message'] = str_replace("\n",'',$error['message']);
24 $error['message'] = str_replace("Uncaught Error:", '', $error['message']);
25 $error['message'] = 'PHP Error: ' . $error['message'];
26 $error['message'] = str_replace(' ', ' ', $error['message']);
27 echo "[[ERROR]]";
28 if($error['message'] == '') {
29 $error['message'] = __('An unknown error occurred', 'wp_all_import_plugin');
30 }
31 $this->terminate(json_encode(array('error' => '<span class="error">'.$error['message'].' of the Functions Editor'.'</span>', 'line' => $error['line'], 'title' => __('PHP Error','wp_all_import_plugin'))));
32 } else if(strpos($error['file'], 'XMLWriter.php') !== false ) {
33 if(strpos($error['message'],'syntax error, unexpected') !== false) {
34 echo "[[ERROR]]";
35 $this->terminate(json_encode(array('error'=>__('You probably forgot to close a quote', 'wp_all_import_plugin'),'title' => __('PHP Error','wp_all_import_plugin'))));
36 }
37 }
38 }
39
40 /**
41 * @return array
42 */
43 protected function getLastError()
44 {
45 return error_get_last();
46 }
47
48 /**
49 * @return mixed
50 */
51 protected function getUploadsDir()
52 {
53 return wp_upload_dir();
54 }
55
56 /**
57 * Hack to be able to test the class in isolation
58 *
59 * @param $message
60 */
61 protected function terminate($message)
62 {
63 exit($message);
64 }
65
66 protected function trace(){
67 $e = new Exception();
68 return $e->getTraceAsString();
69 // return debug_backtrace();
70 }
71
72 public function import_data_handler($errno, $errstr, $errfile, $errline) {
73 error_log('Found import exception: ' . $errstr . ' ' . $errno . ' ' . $errfile . ' ' . $errline . ' for record #' . $this->recordNumber);
74 // trigger_error('TEST');
75 // throw new XmlImportException($errstr, $errno, 0, $errfile, $errline);
76 }
77
78 public function parse_data_handler($errno, $errstr, $errfile, $errline) {
79 error_log('Found parse exception: ' . $errstr . ' ' . $errno . ' ' . $errfile . ' ' . $errline);
80 throw new XmlImportException($errstr, $errno);
81 }
82 }
83