Version Description
- Hotfix - Added a clean up script to consolidate orphaned media posts and remove the old and unused
wp_option_tree
table. - Hotfix - Fixed an issue where
ot_get_media_post_ID()
was never able to set the value of theot_media_post_ID
option because it was already set to empty. Causing theot_create_media_post()
function to create multiple media posts.
Download this release
Release Info
Developer | valendesigns |
Plugin | OptionTree |
Version | 2.4.6 |
Comparing to | |
See all releases |
Code changes from version 2.4.5 to 2.4.6
- includes/ot-cleanup-api.php +293 -0
- includes/ot-functions-admin.php +1 -1
- languages/option-tree.po +112 -3
- ot-loader.php +5 -2
- readme.txt +5 -1
includes/ot-cleanup-api.php
ADDED
@@ -0,0 +1,293 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if ( ! defined( 'OT_VERSION' ) ) exit( 'No direct script access allowed' );
|
2 |
+
/**
|
3 |
+
* OptionTree Cleanup API
|
4 |
+
*
|
5 |
+
* This class loads all the OptionTree Cleanup methods and helpers.
|
6 |
+
*
|
7 |
+
* @package OptionTree
|
8 |
+
* @author Derek Herman <derek@valendesigns.com>
|
9 |
+
* @copyright Copyright (c) 2014, Derek Herman
|
10 |
+
*/
|
11 |
+
if ( ! class_exists( 'OT_Cleanup' ) ) {
|
12 |
+
|
13 |
+
class OT_Cleanup {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* PHP5 constructor method.
|
17 |
+
*
|
18 |
+
* This method adds other methods of the class to specific hooks within WordPress.
|
19 |
+
*
|
20 |
+
* @uses add_action()
|
21 |
+
*
|
22 |
+
* @return void
|
23 |
+
*
|
24 |
+
* @access public
|
25 |
+
* @since 2.4.6
|
26 |
+
*/
|
27 |
+
function __construct() {
|
28 |
+
if ( ! is_admin() )
|
29 |
+
return;
|
30 |
+
|
31 |
+
// Maybe Clean up OptionTree
|
32 |
+
add_action( 'admin_menu', array( $this, 'maybe_cleanup' ), 100 );
|
33 |
+
|
34 |
+
// Increase timeout if allowed
|
35 |
+
add_action( 'ot_pre_consolidate_posts', array( $this, 'increase_timeout' ) );
|
36 |
+
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Check if OptionTree needs to be cleaned up from a previous install.
|
41 |
+
*
|
42 |
+
* @return void
|
43 |
+
*
|
44 |
+
* @access public
|
45 |
+
* @since 2.4.6
|
46 |
+
*/
|
47 |
+
public function maybe_cleanup() {
|
48 |
+
global $wpdb, $table_prefix, $ot_maybe_cleanup_posts, $ot_maybe_cleanup_table;
|
49 |
+
|
50 |
+
$posts = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE post_type = 'option-tree' LIMIT 2" );
|
51 |
+
$table = $wpdb->get_results( "SHOW TABLES LIKE '{$table_prefix}option_tree'" );
|
52 |
+
|
53 |
+
$ot_maybe_cleanup_posts = count( $posts ) > 1;
|
54 |
+
$ot_maybe_cleanup_table = count( $table ) == 1;
|
55 |
+
|
56 |
+
if ( $ot_maybe_cleanup_posts || $ot_maybe_cleanup_table ) {
|
57 |
+
|
58 |
+
add_action( 'admin_notices', array( $this, 'cleanup_notice' ) );
|
59 |
+
|
60 |
+
}
|
61 |
+
|
62 |
+
if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( $_GET['_wpnonce'], 'hide-page' ) ) {
|
63 |
+
update_option( 'ot_hide_cleanup', true );
|
64 |
+
wp_redirect( 'themes.php?page=' . apply_filters( 'ot_theme_options_menu_slug', 'ot-theme-options' ) );
|
65 |
+
exit;
|
66 |
+
}
|
67 |
+
|
68 |
+
if ( $ot_maybe_cleanup_posts || $ot_maybe_cleanup_table || get_option( 'ot_hide_cleanup', false ) == false )
|
69 |
+
add_theme_page( apply_filters( 'ot_cleanup_page_title', __( 'OptionTree Cleanup', 'option-tree' ) ), apply_filters( 'ot_cleanup_menu_title', __( 'OptionTree Cleanup', 'option-tree' ) ), 'edit_theme_options', 'ot-cleanup', array( $this, 'options_page' ) );
|
70 |
+
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Adds an admin nag.
|
75 |
+
*
|
76 |
+
* @return string
|
77 |
+
*
|
78 |
+
* @access public
|
79 |
+
* @since 2.4.6
|
80 |
+
*/
|
81 |
+
public function cleanup_notice() {
|
82 |
+
|
83 |
+
if ( get_current_screen()->id != 'appearance_page_ot-cleanup' )
|
84 |
+
echo '<div class="update-nag">' . sprintf( __( 'OptionTree has outdated data that should be removed. Please go to %s for more information.', 'option-tree' ), sprintf( '<a href="%s">%s</a>', admin_url( 'themes.php?page=ot-cleanup' ), apply_filters( 'ot_cleanup_menu_title', __( 'OptionTree Cleanup', 'option-tree' ) ) ) ) . '</div>';
|
85 |
+
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Adds a Tools sub page to clean up the database with.
|
90 |
+
*
|
91 |
+
* @return string
|
92 |
+
*
|
93 |
+
* @access public
|
94 |
+
* @since 2.4.6
|
95 |
+
*/
|
96 |
+
public function options_page() {
|
97 |
+
global $wpdb, $table_prefix, $ot_maybe_cleanup_posts, $ot_maybe_cleanup_table;
|
98 |
+
|
99 |
+
// If we are here this option should not be true.
|
100 |
+
update_option( 'ot_hide_cleanup', false );
|
101 |
+
|
102 |
+
// Option ID
|
103 |
+
$option_id = 'ot_media_post_ID';
|
104 |
+
|
105 |
+
// Get the media post ID
|
106 |
+
$post_ID = get_option( $option_id, false );
|
107 |
+
|
108 |
+
// Zero loop count
|
109 |
+
$count = 0;
|
110 |
+
|
111 |
+
// Check for safe mode
|
112 |
+
$safe_mode = ini_get( 'safe_mode' );
|
113 |
+
|
114 |
+
echo '<div class="wrap">';
|
115 |
+
|
116 |
+
echo '<h2>' . apply_filters( 'ot_cleanup_page_title', __( 'OptionTree Cleanup', 'option-tree' ) ) . '</h2>';
|
117 |
+
|
118 |
+
if ( $ot_maybe_cleanup_posts || $ot_maybe_cleanup_table ) {
|
119 |
+
|
120 |
+
if ( $ot_maybe_cleanup_posts ) {
|
121 |
+
|
122 |
+
$posts = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE post_type = 'option-tree'" );
|
123 |
+
|
124 |
+
echo '<h3>' . __( 'Multiple Media Posts', 'option-tree' ) . '</h3>';
|
125 |
+
|
126 |
+
echo '<p>' . sprintf( __( 'There are currently %s OptionTree media posts in your database. At some point in the past, a version of OptionTree added multiple %s media post objects cluttering up your %s table. There is no associated risk or harm that these posts have caused other than to add size to your overall database. Thankfully, there is a way to remove all these orphaned media posts and get your database cleaned up.', 'option-tree' ), '<code>' . number_format( count( $posts ) ) . '</code>', '<tt>option-tree</tt>', '<tt>' . $wpdb->posts . '</tt>' ) . '</p>';
|
127 |
+
|
128 |
+
echo '<p>' . sprintf( __( 'By clicking the button below, OptionTree will delete %s records and consolidate them into one single OptionTree media post for uploading attachments to. Additionally, the attachments will have their parent ID updated to the correct media post.', 'option-tree' ), '<code>' . number_format( count( $posts ) - 1 ) . '</code>' ) . '</p>';
|
129 |
+
|
130 |
+
echo '<p><strong>' . __( 'This could take a while to fully process depending on how many records you have in your database, so please be patient and wait for the script to finish.', 'option-tree' ) . '</strong></p>';
|
131 |
+
|
132 |
+
echo $safe_mode ? '<p>' . sprintf( __( '%s Your server is running in safe mode. Which means this page will automatically reload after deleting %s posts, you can filter this number using %s if your server is having trouble processing that many at one time.', 'option-tree' ), '<strong>Note</strong>:', apply_filters( 'ot_consolidate_posts_reload', 500 ), '<tt>ot_consolidate_posts_reload</tt>' ) . '</p>' : '';
|
133 |
+
|
134 |
+
echo '<p><a class="button button-primary" href="' . wp_nonce_url( admin_url( 'themes.php?page=ot-cleanup' ), 'consolidate-posts' ) . '">' . __( 'Consolidate Posts', 'option-tree' ) . '</a></p>';
|
135 |
+
|
136 |
+
if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( $_GET['_wpnonce'], 'consolidate-posts' ) ) {
|
137 |
+
|
138 |
+
if ( $post_ID === false || empty( $post_ID ) ) {
|
139 |
+
$post_ID = isset( $posts[0]->ID ) ? $posts[0]->ID : null;
|
140 |
+
|
141 |
+
// Add to the DB
|
142 |
+
if ( $post_ID !== null )
|
143 |
+
update_option( $option_id, $post_ID );
|
144 |
+
|
145 |
+
}
|
146 |
+
|
147 |
+
// Do pre consolidation action to increase timeout.
|
148 |
+
do_action( 'ot_pre_consolidate_posts' );
|
149 |
+
|
150 |
+
// Loop over posts
|
151 |
+
foreach( $posts as $post ) {
|
152 |
+
|
153 |
+
// Don't destroy the correct post.
|
154 |
+
if ( $post_ID == $post->ID )
|
155 |
+
continue;
|
156 |
+
|
157 |
+
// Update count
|
158 |
+
$count++;
|
159 |
+
|
160 |
+
// Reload script in safe mode
|
161 |
+
if ( $safe_mode && $count > apply_filters( 'ot_consolidate_posts_reload', 500 ) ) {
|
162 |
+
echo '<br />' . __( 'Reloading...', 'option-tree' );
|
163 |
+
echo '
|
164 |
+
<script>
|
165 |
+
setTimeout( ot_script_reload, 3000 )
|
166 |
+
function ot_script_reload() {
|
167 |
+
window.location = "' . self_admin_url( 'themes.php?page=ot-cleanup&_wpnonce=' . wp_create_nonce( 'consolidate-posts' ) ) . '"
|
168 |
+
}
|
169 |
+
</script>';
|
170 |
+
break;
|
171 |
+
}
|
172 |
+
|
173 |
+
// Get the attachements
|
174 |
+
$attachments = get_children( 'post_type=attachment&post_parent=' . $post->ID );
|
175 |
+
|
176 |
+
// Update the attachments parent ID
|
177 |
+
if ( ! empty( $attachments ) ) {
|
178 |
+
|
179 |
+
echo 'Updating Attachments parent ID for <tt>option-tree</tt> post <tt>#' . $post->ID . '</tt>.<br />';
|
180 |
+
|
181 |
+
foreach( $attachments as $attachment_id => $attachment ) {
|
182 |
+
wp_update_post(
|
183 |
+
array(
|
184 |
+
'ID' => $attachment_id,
|
185 |
+
'post_parent' => $post_ID
|
186 |
+
)
|
187 |
+
);
|
188 |
+
}
|
189 |
+
|
190 |
+
}
|
191 |
+
|
192 |
+
// Delete post
|
193 |
+
echo 'Deleting <tt>option-tree</tt> post <tt>#' . $post->ID . '</tt><br />';
|
194 |
+
wp_delete_post( $post->ID, true );
|
195 |
+
|
196 |
+
}
|
197 |
+
|
198 |
+
echo '<br />' . __( 'Clean up script has completed, the page will now reload...', 'option-tree' );
|
199 |
+
|
200 |
+
echo '
|
201 |
+
<script>
|
202 |
+
setTimeout( ot_script_reload, 3000 )
|
203 |
+
function ot_script_reload() {
|
204 |
+
window.location = "' . self_admin_url( 'themes.php?page=ot-cleanup' ) . '"
|
205 |
+
}
|
206 |
+
</script>';
|
207 |
+
|
208 |
+
}
|
209 |
+
|
210 |
+
}
|
211 |
+
|
212 |
+
if ( $ot_maybe_cleanup_table ) {
|
213 |
+
|
214 |
+
$table_name = $table_prefix . 'option_tree';
|
215 |
+
|
216 |
+
echo $ot_maybe_cleanup_posts ? '<hr />' : '';
|
217 |
+
|
218 |
+
echo '<h3>' . __( 'Outdated Table', 'option-tree' ) . '</h3>';
|
219 |
+
|
220 |
+
echo '<p>' . sprintf( __( 'If you have upgraded from an old 1.x version of OptionTree at some point, you have an extra %s table in your database that can be removed. It\'s not hurting anything, but does not need to be there. If you want to remove it. Click the button below.', 'option-tree' ), '<tt>' . $table_name . '</tt>' ) . '</p>';
|
221 |
+
|
222 |
+
echo '<p><a class="button button-primary" href="' . wp_nonce_url( admin_url( 'themes.php?page=ot-cleanup' ), 'drop-table' ) . '">' . __( 'Drop Table', 'option-tree' ) . '</a></p>';
|
223 |
+
|
224 |
+
if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( $_GET['_wpnonce'], 'drop-table' ) ) {
|
225 |
+
|
226 |
+
echo '<p>' . sprintf( __( 'Deleting the outdated and unused %s table...', 'option-tree' ), '<tt>' . $table_name . '</tt>' ) . '</p>';
|
227 |
+
|
228 |
+
$wpdb->query( "DROP TABLE IF EXISTS $table_name" );
|
229 |
+
|
230 |
+
if ( count( $wpdb->get_results( "SHOW TABLES LIKE '{$table_prefix}option_tree'" ) ) == 0 ) {
|
231 |
+
|
232 |
+
echo '<p>' . sprintf( __( 'The %s table has been successfully deleted. The page will now reload...', 'option-tree' ), '<tt>' . $table_name . '</tt>' ) . '</p>';
|
233 |
+
|
234 |
+
echo '
|
235 |
+
<script>
|
236 |
+
setTimeout( ot_script_reload, 3000 )
|
237 |
+
function ot_script_reload() {
|
238 |
+
window.location = "' . self_admin_url( 'themes.php?page=ot-cleanup' ) . '"
|
239 |
+
}
|
240 |
+
</script>';
|
241 |
+
|
242 |
+
} else {
|
243 |
+
|
244 |
+
echo '<p>' . sprintf( __( 'Something went wrong. The %s table was not deleted.', 'option-tree' ), '<tt>' . $table_name . '</tt>' ) . '</p>';
|
245 |
+
|
246 |
+
}
|
247 |
+
|
248 |
+
}
|
249 |
+
|
250 |
+
}
|
251 |
+
|
252 |
+
} else {
|
253 |
+
|
254 |
+
echo '<h3>' . __( 'Congratulations! You have a clean install.', 'option-tree' ) . '</h3>';
|
255 |
+
|
256 |
+
echo '<p>' . __( 'Your version of OptionTree does not have any outdated data. If there was outdated data, you would be presented with options to clean it up.', 'option-tree' ) . '</p>';
|
257 |
+
|
258 |
+
echo '<p><a class="button button-primary" href="' . wp_nonce_url( admin_url( 'themes.php?page=ot-cleanup' ), 'hide-page' ) . '">' . __( 'Hide This Page', 'option-tree' ) . '</a></p>';
|
259 |
+
|
260 |
+
}
|
261 |
+
|
262 |
+
echo '</div>';
|
263 |
+
|
264 |
+
}
|
265 |
+
|
266 |
+
/**
|
267 |
+
* Increase PHP timeout.
|
268 |
+
*
|
269 |
+
* This is to prevent bulk operations from timing out
|
270 |
+
*
|
271 |
+
* @return void
|
272 |
+
*
|
273 |
+
* @access public
|
274 |
+
* @since 2.4.6
|
275 |
+
*/
|
276 |
+
public function increase_timeout() {
|
277 |
+
|
278 |
+
if ( ! ini_get( 'safe_mode' ) ) {
|
279 |
+
|
280 |
+
@set_time_limit( 0 );
|
281 |
+
|
282 |
+
}
|
283 |
+
|
284 |
+
}
|
285 |
+
|
286 |
+
}
|
287 |
+
|
288 |
+
}
|
289 |
+
|
290 |
+
new OT_Cleanup();
|
291 |
+
|
292 |
+
/* End of file ot-cleanup-api.php */
|
293 |
+
/* Location: ./includes/ot-cleanup-api.php */
|
includes/ot-functions-admin.php
CHANGED
@@ -703,7 +703,7 @@ if ( ! function_exists( 'ot_get_media_post_ID' ) ) {
|
|
703 |
$post_ID = get_option( $option_id, false );
|
704 |
|
705 |
// Add $post_ID to the DB
|
706 |
-
if ( $post_ID === false ) {
|
707 |
global $wpdb;
|
708 |
|
709 |
// Get the media post ID
|
703 |
$post_ID = get_option( $option_id, false );
|
704 |
|
705 |
// Add $post_ID to the DB
|
706 |
+
if ( $post_ID === false || empty( $post_ID ) ) {
|
707 |
global $wpdb;
|
708 |
|
709 |
// Get the media post ID
|
languages/option-tree.po
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: OptionTree\n"
|
4 |
-
"POT-Creation-Date: 2014-11-
|
5 |
-
"PO-Revision-Date: 2014-11-
|
6 |
"Last-Translator: Derek Herman <derek@valendesigns.com>\n"
|
7 |
"Language-Team: Valen Designs\n"
|
8 |
"Language: English\n"
|
@@ -24,7 +24,7 @@ msgid ""
|
|
24 |
"OptionTree, and remove this warning."
|
25 |
msgstr ""
|
26 |
|
27 |
-
#: ../ot-loader.php:
|
28 |
#: ../includes/ot-functions-admin.php:657
|
29 |
#: ../includes/ot-functions-docs-page.php:374
|
30 |
#: ../includes/ot-functions-settings-page.php:170
|
@@ -679,6 +679,115 @@ msgid ""
|
|
679 |
"the class attribute."
|
680 |
msgstr ""
|
681 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
682 |
#: ../includes/ot-functions-admin.php:50 ../includes/ot-functions-admin.php:51
|
683 |
#: ../includes/ot-functions-admin.php:169
|
684 |
#: ../includes/ot-functions-admin.php:193 ../includes/ot-functions.php:284
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: OptionTree\n"
|
4 |
+
"POT-Creation-Date: 2014-11-20 23:06-0800\n"
|
5 |
+
"PO-Revision-Date: 2014-11-20 23:06-0800\n"
|
6 |
"Last-Translator: Derek Herman <derek@valendesigns.com>\n"
|
7 |
"Language-Team: Valen Designs\n"
|
8 |
"Language: English\n"
|
24 |
"OptionTree, and remove this warning."
|
25 |
msgstr ""
|
26 |
|
27 |
+
#: ../ot-loader.php:752 ../assets/theme-mode/demo-theme-options.php:639
|
28 |
#: ../includes/ot-functions-admin.php:657
|
29 |
#: ../includes/ot-functions-docs-page.php:374
|
30 |
#: ../includes/ot-functions-settings-page.php:170
|
679 |
"the class attribute."
|
680 |
msgstr ""
|
681 |
|
682 |
+
#: ../includes/ot-cleanup-api.php:69 ../includes/ot-cleanup-api.php:84
|
683 |
+
#: ../includes/ot-cleanup-api.php:116
|
684 |
+
msgid "OptionTree Cleanup"
|
685 |
+
msgstr ""
|
686 |
+
|
687 |
+
#: ../includes/ot-cleanup-api.php:84
|
688 |
+
#, php-format
|
689 |
+
msgid ""
|
690 |
+
"OptionTree has outdated data that should be removed. Please go to %s for "
|
691 |
+
"more information."
|
692 |
+
msgstr ""
|
693 |
+
|
694 |
+
#: ../includes/ot-cleanup-api.php:124
|
695 |
+
msgid "Multiple Media Posts"
|
696 |
+
msgstr ""
|
697 |
+
|
698 |
+
#: ../includes/ot-cleanup-api.php:126
|
699 |
+
#, php-format
|
700 |
+
msgid ""
|
701 |
+
"There are currently %s OptionTree media posts in your database. At some "
|
702 |
+
"point in the past, a version of OptionTree added multiple %s media post "
|
703 |
+
"objects cluttering up your %s table. There is no associated risk or harm "
|
704 |
+
"that these posts have caused other than to add size to your overall "
|
705 |
+
"database. Thankfully, there is a way to remove all these orphaned media "
|
706 |
+
"posts and get your database cleaned up."
|
707 |
+
msgstr ""
|
708 |
+
|
709 |
+
#: ../includes/ot-cleanup-api.php:128
|
710 |
+
#, php-format
|
711 |
+
msgid ""
|
712 |
+
"By clicking the button below, OptionTree will delete %s records and "
|
713 |
+
"consolidate them into one single OptionTree media post for uploading "
|
714 |
+
"attachments to. Additionally, the attachments will have their parent ID "
|
715 |
+
"updated to the correct media post."
|
716 |
+
msgstr ""
|
717 |
+
|
718 |
+
#: ../includes/ot-cleanup-api.php:130
|
719 |
+
msgid ""
|
720 |
+
"This could take a while to fully process depending on how many records you "
|
721 |
+
"have in your database, so please be patient and wait for the script to "
|
722 |
+
"finish."
|
723 |
+
msgstr ""
|
724 |
+
|
725 |
+
#: ../includes/ot-cleanup-api.php:132
|
726 |
+
#, php-format
|
727 |
+
msgid ""
|
728 |
+
"%s Your server is running in safe mode. Which means this page will "
|
729 |
+
"automatically reload after deleting %s posts, you can filter this number "
|
730 |
+
"using %s if your server is having trouble processing that many at one time."
|
731 |
+
msgstr ""
|
732 |
+
|
733 |
+
#: ../includes/ot-cleanup-api.php:134
|
734 |
+
msgid "Consolidate Posts"
|
735 |
+
msgstr ""
|
736 |
+
|
737 |
+
#: ../includes/ot-cleanup-api.php:162
|
738 |
+
msgid "Reloading..."
|
739 |
+
msgstr ""
|
740 |
+
|
741 |
+
#: ../includes/ot-cleanup-api.php:198
|
742 |
+
msgid "Clean up script has completed, the page will now reload..."
|
743 |
+
msgstr ""
|
744 |
+
|
745 |
+
#: ../includes/ot-cleanup-api.php:218
|
746 |
+
msgid "Outdated Table"
|
747 |
+
msgstr ""
|
748 |
+
|
749 |
+
#: ../includes/ot-cleanup-api.php:220
|
750 |
+
#, php-format
|
751 |
+
msgid ""
|
752 |
+
"If you have upgraded from an old 1.x version of OptionTree at some point, "
|
753 |
+
"you have an extra %s table in your database that can be removed. It's not "
|
754 |
+
"hurting anything, but does not need to be there. If you want to remove it. "
|
755 |
+
"Click the button below."
|
756 |
+
msgstr ""
|
757 |
+
|
758 |
+
#: ../includes/ot-cleanup-api.php:222
|
759 |
+
msgid "Drop Table"
|
760 |
+
msgstr ""
|
761 |
+
|
762 |
+
#: ../includes/ot-cleanup-api.php:226
|
763 |
+
#, php-format
|
764 |
+
msgid "Deleting the outdated and unused %s table..."
|
765 |
+
msgstr ""
|
766 |
+
|
767 |
+
#: ../includes/ot-cleanup-api.php:232
|
768 |
+
#, php-format
|
769 |
+
msgid "The %s table has been successfully deleted. The page will now reload..."
|
770 |
+
msgstr ""
|
771 |
+
|
772 |
+
#: ../includes/ot-cleanup-api.php:244
|
773 |
+
#, php-format
|
774 |
+
msgid "Something went wrong. The %s table was not deleted."
|
775 |
+
msgstr ""
|
776 |
+
|
777 |
+
#: ../includes/ot-cleanup-api.php:254
|
778 |
+
msgid "Congratulations! You have a clean install."
|
779 |
+
msgstr ""
|
780 |
+
|
781 |
+
#: ../includes/ot-cleanup-api.php:256
|
782 |
+
msgid ""
|
783 |
+
"Your version of OptionTree does not have any outdated data. If there was "
|
784 |
+
"outdated data, you would be presented with options to clean it up."
|
785 |
+
msgstr ""
|
786 |
+
|
787 |
+
#: ../includes/ot-cleanup-api.php:258
|
788 |
+
msgid "Hide This Page"
|
789 |
+
msgstr ""
|
790 |
+
|
791 |
#: ../includes/ot-functions-admin.php:50 ../includes/ot-functions-admin.php:51
|
792 |
#: ../includes/ot-functions-admin.php:169
|
793 |
#: ../includes/ot-functions-admin.php:193 ../includes/ot-functions.php:284
|
ot-loader.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: OptionTree
|
4 |
* Plugin URI: https://github.com/valendesigns/option-tree/
|
5 |
* Description: Theme Options UI Builder for WordPress. A simple way to create & save Theme Options and Meta Boxes for free or premium themes.
|
6 |
-
* Version: 2.4.
|
7 |
* Author: Derek Herman
|
8 |
* Author URI: http://valendesigns.com
|
9 |
* License: GPLv3
|
@@ -178,7 +178,7 @@ if ( ! class_exists( 'OT_Loader' ) ) {
|
|
178 |
/**
|
179 |
* Current Version number.
|
180 |
*/
|
181 |
-
define( 'OT_VERSION', '2.4.
|
182 |
|
183 |
/**
|
184 |
* For developers: Theme mode.
|
@@ -382,6 +382,9 @@ if ( ! class_exists( 'OT_Loader' ) ) {
|
|
382 |
$files[] = 'ot-functions-docs-page';
|
383 |
}
|
384 |
|
|
|
|
|
|
|
385 |
/* require the files */
|
386 |
foreach ( $files as $file ) {
|
387 |
$this->load_file( OT_DIR . "includes" . DIRECTORY_SEPARATOR . "{$file}.php" );
|
3 |
* Plugin Name: OptionTree
|
4 |
* Plugin URI: https://github.com/valendesigns/option-tree/
|
5 |
* Description: Theme Options UI Builder for WordPress. A simple way to create & save Theme Options and Meta Boxes for free or premium themes.
|
6 |
+
* Version: 2.4.6
|
7 |
* Author: Derek Herman
|
8 |
* Author URI: http://valendesigns.com
|
9 |
* License: GPLv3
|
178 |
/**
|
179 |
* Current Version number.
|
180 |
*/
|
181 |
+
define( 'OT_VERSION', '2.4.6' );
|
182 |
|
183 |
/**
|
184 |
* For developers: Theme mode.
|
382 |
$files[] = 'ot-functions-docs-page';
|
383 |
}
|
384 |
|
385 |
+
/* include the cleanup api */
|
386 |
+
$files[] = 'ot-cleanup-api';
|
387 |
+
|
388 |
/* require the files */
|
389 |
foreach ( $files as $file ) {
|
390 |
$this->load_file( OT_DIR . "includes" . DIRECTORY_SEPARATOR . "{$file}.php" );
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://bit.ly/NuXI3T
|
|
4 |
Tags: options, theme options, meta boxes
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 4.0
|
7 |
-
Stable tag: 2.4.
|
8 |
License: GPLv3
|
9 |
|
10 |
Theme Options UI Builder for WordPress. A simple way to create & save Theme Options and Meta Boxes for free or premium themes.
|
@@ -118,6 +118,10 @@ The most likely scenario is your theme already has OptionTree installed in Theme
|
|
118 |
|
119 |
== Changelog ==
|
120 |
|
|
|
|
|
|
|
|
|
121 |
= 2.4.5 =
|
122 |
* Hotfix - Fixed an issue where `ot_get_media_post_ID()` was setting the value of the `ot_media_post_ID` option to `null`. Causing the `ot_create_media_post()` function to create multiple media posts. A clean up script will be added to `2.5.0`.
|
123 |
|
4 |
Tags: options, theme options, meta boxes
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 4.0
|
7 |
+
Stable tag: 2.4.6
|
8 |
License: GPLv3
|
9 |
|
10 |
Theme Options UI Builder for WordPress. A simple way to create & save Theme Options and Meta Boxes for free or premium themes.
|
118 |
|
119 |
== Changelog ==
|
120 |
|
121 |
+
= 2.4.6 =
|
122 |
+
* Hotfix - Added a clean up script to consolidate orphaned media posts and remove the old and unused `wp_option_tree` table.
|
123 |
+
* Hotfix - Fixed an issue where `ot_get_media_post_ID()` was never able to set the value of the `ot_media_post_ID` option because it was already set to empty. Causing the `ot_create_media_post()` function to create multiple media posts.
|
124 |
+
|
125 |
= 2.4.5 =
|
126 |
* Hotfix - Fixed an issue where `ot_get_media_post_ID()` was setting the value of the `ot_media_post_ID` option to `null`. Causing the `ot_create_media_post()` function to create multiple media posts. A clean up script will be added to `2.5.0`.
|
127 |
|