Version Description
- Improve uninstall routine
Download this release
Release Info
Developer | arisoft |
Plugin | ARI Adminer – WordPress Database Manager |
Version | 1.0.4 |
Comparing to | |
See all releases |
Code changes from version 1.0.3 to 1.0.4
- ari-adminer.php +1 -1
- includes/defines.php +1 -1
- libraries/arisoft/core/utils/class-array-helper.php +95 -0
- readme.txt +9 -3
- uninstall.php +41 -0
ari-adminer.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: ARI Adminer
|
4 |
Plugin URI: http://wp-quiz.ari-soft.com/plugins/wordpress-adminer.html
|
5 |
Description: Powerful, compact and easy to use database manager plugin for WordPress.
|
6 |
-
Version: 1.0.
|
7 |
Author: ARI Soft
|
8 |
Author URI: http://www.ari-soft.com
|
9 |
Text Domain: ari-adminer
|
3 |
Plugin Name: ARI Adminer
|
4 |
Plugin URI: http://wp-quiz.ari-soft.com/plugins/wordpress-adminer.html
|
5 |
Description: Powerful, compact and easy to use database manager plugin for WordPress.
|
6 |
+
Version: 1.0.4
|
7 |
Author: ARI Soft
|
8 |
Author URI: http://www.ari-soft.com
|
9 |
Text Domain: ari-adminer
|
includes/defines.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<?php
|
2 |
-
define( 'ARIADMINER_VERSION', '1.0.
|
3 |
define( 'ARIADMINER_SLUG', 'ari-adminer' );
|
4 |
define( 'ARIADMINER_ASSETS_URL', ARIADMINER_URL . 'assets/' );
|
5 |
define( 'ARIADMINER_VERSION_OPTION', 'ari_adminer' );
|
1 |
<?php
|
2 |
+
define( 'ARIADMINER_VERSION', '1.0.4' );
|
3 |
define( 'ARIADMINER_SLUG', 'ari-adminer' );
|
4 |
define( 'ARIADMINER_ASSETS_URL', ARIADMINER_URL . 'assets/' );
|
5 |
define( 'ARIADMINER_VERSION_OPTION', 'ari_adminer' );
|
libraries/arisoft/core/utils/class-array-helper.php
CHANGED
@@ -52,4 +52,99 @@ class Array_Helper {
|
|
52 |
|
53 |
return $val;
|
54 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
}
|
52 |
|
53 |
return $val;
|
54 |
}
|
55 |
+
|
56 |
+
static public function is_assoc( $array ) {
|
57 |
+
$cnt = is_array( $array ) ? count( $array ) : 0;
|
58 |
+
if ( 0 === $cnt )
|
59 |
+
return false;
|
60 |
+
|
61 |
+
for ( reset( $array ); is_int( key( $array ) ); next( $array ) );
|
62 |
+
|
63 |
+
return ! is_null( key( $array ) );
|
64 |
+
}
|
65 |
+
|
66 |
+
static public function to_flat_array( $params, $delimiter = '$$', $prefix = '' ) {
|
67 |
+
$result = array();
|
68 |
+
|
69 |
+
if ( ! is_array( $params ) )
|
70 |
+
return $result;
|
71 |
+
|
72 |
+
foreach ( $params as $key => $val ) {
|
73 |
+
if ( self::is_assoc( $val ) ) {
|
74 |
+
$result = array_merge( $result, self::to_flat_array( $val, $delimiter, $prefix . $key . $delimiter ) );
|
75 |
+
} else {
|
76 |
+
$result[$prefix . $key] = $val;
|
77 |
+
}
|
78 |
+
}
|
79 |
+
|
80 |
+
return $result;
|
81 |
+
}
|
82 |
+
|
83 |
+
static public function to_complex_array( $params, $delimiter = '$$' ) {
|
84 |
+
$result = array();
|
85 |
+
|
86 |
+
if ( ! is_array( $params ) )
|
87 |
+
return $result;
|
88 |
+
|
89 |
+
foreach ( $params as $key => $val ) {
|
90 |
+
$complex_keys = explode( $delimiter, $key );
|
91 |
+
|
92 |
+
$item = &$result;
|
93 |
+
$key_count = count( $complex_keys );
|
94 |
+
for ( $i = 0; $i < $key_count - 1; $i++ ) {
|
95 |
+
if ( ! isset( $item[$complex_keys[$i]] ) ) {
|
96 |
+
$item[$complex_keys[$i]] = array();
|
97 |
+
}
|
98 |
+
|
99 |
+
$item =& $item[$complex_keys[$i]];
|
100 |
+
}
|
101 |
+
|
102 |
+
$item[$complex_keys[$key_count - 1]] = $val;
|
103 |
+
}
|
104 |
+
|
105 |
+
return $result;
|
106 |
+
}
|
107 |
+
|
108 |
+
static public function value_by_path( $path, $src, $separator = '.', $default = null ) {
|
109 |
+
$keys = explode( $separator, $path );
|
110 |
+
|
111 |
+
$val =& $src;
|
112 |
+
foreach ( $keys as $key ) {
|
113 |
+
if ( isset( $val[$key] ) ) {
|
114 |
+
$val =& $val[$key];
|
115 |
+
} else {
|
116 |
+
$val = $default;
|
117 |
+
break;
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
return $val;
|
122 |
+
}
|
123 |
+
|
124 |
+
static public function get_unique_override_parameters( $src, $override ) {
|
125 |
+
$unique_params = array();
|
126 |
+
if ( is_null( $override ) )
|
127 |
+
$override = array();
|
128 |
+
|
129 |
+
foreach ( $src as $src_key => $src_value ) {
|
130 |
+
if ( is_array( $src_value ) ) {
|
131 |
+
if ( isset( $override[$src_key] ) ) {
|
132 |
+
$sub_params = self::get_unique_override_parameters(
|
133 |
+
$src_value,
|
134 |
+
$override[$src_key]
|
135 |
+
);
|
136 |
+
|
137 |
+
if ( count( $sub_params ) > 0 )
|
138 |
+
$unique_params[$src_key] = $sub_params;
|
139 |
+
}
|
140 |
+
} else if ( array_key_exists( $src_key, $override ) ) {
|
141 |
+
$override_value = $override[$src_key];
|
142 |
+
|
143 |
+
if ( $override_value != $src_value )
|
144 |
+
$unique_params[$src_key] = $override_value;
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
return $unique_params;
|
149 |
+
}
|
150 |
}
|
readme.txt
CHANGED
@@ -3,12 +3,12 @@ Contributors: arisoft
|
|
3 |
Donate link: http://wp-quiz.ari-soft.com/plugins/wordpress-adminer.html
|
4 |
Tags: adminer, sql, database, mysql, report, sqlite, table, postgresql, dump, backup, import, export, phpmyadmin
|
5 |
Requires at least: 4.0
|
6 |
-
Tested up to: 4.7.
|
7 |
-
Stable tag: 1.0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
-
WordPress Database
|
12 |
|
13 |
== Description ==
|
14 |
|
@@ -69,6 +69,9 @@ Sure, it is available [here](http://www.ari-soft.com/docs/wordpress/ari-adminer/
|
|
69 |
|
70 |
== Changelog ==
|
71 |
|
|
|
|
|
|
|
72 |
= 1.0.3 =
|
73 |
* Russian translation is added
|
74 |
|
@@ -84,6 +87,9 @@ Sure, it is available [here](http://www.ari-soft.com/docs/wordpress/ari-adminer/
|
|
84 |
|
85 |
== Upgrade Notice ==
|
86 |
|
|
|
|
|
|
|
87 |
= 1.0.3 =
|
88 |
* Russian translation is added
|
89 |
|
3 |
Donate link: http://wp-quiz.ari-soft.com/plugins/wordpress-adminer.html
|
4 |
Tags: adminer, sql, database, mysql, report, sqlite, table, postgresql, dump, backup, import, export, phpmyadmin
|
5 |
Requires at least: 4.0
|
6 |
+
Tested up to: 4.7.1
|
7 |
+
Stable tag: 1.0.4
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
+
WordPress Database Management Tool based on Adminer application.
|
12 |
|
13 |
== Description ==
|
14 |
|
69 |
|
70 |
== Changelog ==
|
71 |
|
72 |
+
= 1.0.4 =
|
73 |
+
* Improve uninstall routine
|
74 |
+
|
75 |
= 1.0.3 =
|
76 |
* Russian translation is added
|
77 |
|
87 |
|
88 |
== Upgrade Notice ==
|
89 |
|
90 |
+
= 1.0.4 =
|
91 |
+
* Improve uninstall routine
|
92 |
+
|
93 |
= 1.0.3 =
|
94 |
* Russian translation is added
|
95 |
|
uninstall.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) )
|
3 |
+
exit();
|
4 |
+
|
5 |
+
$queries = array(
|
6 |
+
'DROP TABLE IF EXISTS `%1$sariadminer_connections`'
|
7 |
+
);
|
8 |
+
|
9 |
+
function execute_queries( $queries ) {
|
10 |
+
global $wpdb;
|
11 |
+
|
12 |
+
foreach ( $queries as $query ) {
|
13 |
+
$wpdb->query(
|
14 |
+
sprintf(
|
15 |
+
$query,
|
16 |
+
$wpdb->prefix
|
17 |
+
)
|
18 |
+
);
|
19 |
+
}
|
20 |
+
}
|
21 |
+
|
22 |
+
if ( ! is_multisite() ) {
|
23 |
+
execute_queries( $queries );
|
24 |
+
delete_option( 'ari_adminer' );
|
25 |
+
delete_option( 'ari_adminer_settings' );
|
26 |
+
} else {
|
27 |
+
global $wpdb;
|
28 |
+
|
29 |
+
$blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
|
30 |
+
$original_blog_id = get_current_blog_id();
|
31 |
+
|
32 |
+
foreach ( $blog_ids as $blog_id ) {
|
33 |
+
switch_to_blog( $blog_id );
|
34 |
+
|
35 |
+
execute_queries( $queries );
|
36 |
+
delete_option( 'ari_adminer' );
|
37 |
+
delete_option( 'ari_adminer_settings' );
|
38 |
+
}
|
39 |
+
|
40 |
+
switch_to_blog( $original_blog_id );
|
41 |
+
}
|