PluginProbe ʕ •ᴥ•ʔ
Pods – Custom Content Types and Fields / 2.8.23.4
Pods – Custom Content Types and Fields v2.8.23.4
2.8.23.4 2.9.19.4 3.0.10.4 3.1.4.2 3.2.8.3 3.3.9.1 trunk 1.14.8 2.7.31.3 2.8.23.3 2.9.19.3 3.0.10.3 3.1.4.1 3.2.0 3.2.1 3.2.1.1 3.2.2 3.2.4 3.2.5 3.2.6 3.2.7 3.2.7.1 3.2.8 3.2.8.1 3.2.8.2 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
pods / ui / admin / settings-reset.php
pods / ui / admin Last commit date
callouts 2 weeks ago upgrade 2 weeks ago widgets 2 weeks ago components-admin.php 2 weeks ago help.php 2 weeks ago postbox-header.php 2 weeks ago settings-reset.php 2 weeks ago settings-settings.php 2 weeks ago settings.php 2 weeks ago setup-add.php 2 weeks ago setup-edit.php 2 weeks ago shortcode.php 2 weeks ago view.php 2 weeks ago
settings-reset.php
188 lines
1 <?php
2 // Don't load directly.
3 if ( ! defined( 'ABSPATH' ) || ! pods_is_admin( 'pods_settings' ) ) {
4 die( '-1' );
5 }
6
7 /** @var $pods_init PodsInit */
8 global $pods_init, $wpdb;
9
10 $relationship_table = $wpdb->prefix . 'podsrel';
11
12 if ( isset( $_POST['_wpnonce'] ) && false !== wp_verify_nonce( $_POST['_wpnonce'], 'pods-settings' ) ) {
13 if ( isset( $_POST['pods_cleanup_1x'] ) ) {
14 pods_upgrade( '2.0.0' )->cleanup();
15
16 pods_redirect( pods_query_arg( array( 'pods_cleanup_1x_success' => 1 ), array( 'page', 'tab' ) ) );
17 } elseif ( isset( $_POST['pods_reset'] ) ) {
18 $pods_init->reset();
19 $pods_init->setup();
20
21 pods_redirect( pods_query_arg( array( 'pods_reset_success' => 1 ), array( 'page', 'tab' ) ) );
22 } elseif ( isset( $_POST['pods_reset_deactivate'] ) ) {
23 $pods_init->reset();
24
25 deactivate_plugins( PODS_DIR . 'init.php' );
26
27 pods_redirect( 'index.php' );
28 } elseif ( isset( $_POST['pods_recreate_tables'] ) ) {
29 pods_upgrade()->delta_tables();
30
31 pods_redirect( pods_query_arg( array( 'pods_recreate_tables_success' => 1 ), array( 'page', 'tab' ) ) );
32 }
33 } elseif ( 1 === (int) pods_v( 'pods_reset_success' ) ) {
34 pods_message( 'Pods 2.x settings and data have been reset.' );
35 } elseif ( 1 === (int) pods_v( 'pods_cleanup_1x_success' ) ) {
36 pods_message( 'Pods 1.x data has been deleted.' );
37 } elseif ( 1 === (int) pods_v( 'pods_recreate_tables_success' ) ) {
38 pods_message( 'Pods tables have been recreated.' );
39 }
40
41 // Monday Mode
42 $monday_mode = pods_v( 'pods_monday_mode', 'get', 0, true );
43
44 if ( pods_v_sanitized( 'pods_reset_weekend', 'post', pods_v_sanitized( 'pods_reset_weekend', 'get', 0, null, true ), null, true ) ) {
45 if ( $monday_mode ) {
46 $html = '<br /><br /><iframe width="480" height="360" src="https://www.youtube-nocookie.com/embed/QH2-TGUlwu4?autoplay=1" frameborder="0" allowfullscreen></iframe>';
47 pods_message( 'The weekend has been reset and you have been sent back to Friday night. Unfortunately due to a tear in the fabric of time, you slipped back to Monday. We took video of the whole process and you can see it below..' . $html );
48 } else {
49 $html = '<br /><br /><iframe width="480" height="360" src="https://www.youtube-nocookie.com/embed/QH2-TGUlwu4?autoplay=1" frameborder="0" allowfullscreen></iframe>';
50 pods_message( 'Oops, sorry! You can only reset the weekend on a Monday before the end of the work day. Somebody call the Waaambulance!' . $html, 'error' );
51 }
52 }
53
54 // Please Note:
55 $please_note = __( 'Please Note:' );
56
57 $old_version = get_option( 'pods_version' );
58
59 if ( ! empty( $old_version ) ) {
60 ?>
61 <h3><?php esc_html_e( 'Delete Pods 1.x data', 'pods' ); ?></h3>
62
63 <p><?php esc_html_e( 'This will delete all of your Pods 1.x data, it\'s only recommended if you\'ve verified your data has been properly migrated into Pods 2.x.', 'pods' ); ?></p>
64
65 <p class="submit">
66 <?php $confirm = __( "Are you sure you want to do this?\n\nThis is a good time to make sure you have a backup. We are deleting all of the data that surrounds 1.x, resetting it to a clean first install.", 'pods' ); ?>
67 <input type="submit" class="button button-primary" name="pods_cleanup_1x" value=" <?php esc_attr_e( 'Delete Pods 1.x settings and data', 'pods' ); ?> " onclick="return confirm( '<?php echo esc_js( $confirm ); ?>' );" />
68 </p>
69
70 <hr />
71
72 <h3><?php esc_html_e( 'Reset Pods 2.x', 'pods' ); ?></h3>
73
74 <p><?php esc_html_e( 'This does not delete any Pods 1.x data, it simply resets the Pods 2.x settings, removes all of it\'s data, and performs a fresh install.', 'pods' ); ?></p>
75 <p><?php echo sprintf( '<strong>%1$s</strong>', $please_note ) . __( 'This does not remove any items from any Post Types, Taxonomies, Media, Users, or Comments data you have added/modified. Any custom fields stored using the table storage component, content in Advanced Content Types, and relationships between posts will be lost.', 'pods' ); ?></p>
76
77 <p class="submit">
78 <?php $confirm = __( "Are you sure you want to do this?\n\nThis is a good time to make sure you have a backup. We are deleting all of the data that surrounds 2.x, resetting it to a clean first install.", 'pods' ); ?>
79 <input type="submit" class="button button-primary" name="pods_reset" value=" <?php esc_attr_e( 'Reset Pods 2.x settings and data', 'pods' ); ?> " onclick="return confirm( '<?php echo esc_js( $confirm ); ?>' );" />
80 </p>
81
82 <hr />
83
84 <h3><?php esc_html_e( 'Deactivate and Delete Pods 2.x data', 'pods' ); ?></h3>
85
86 <p><?php esc_html_e( 'This will delete Pods 2.x settings, data, and deactivate itself once done. Your database will be as if Pods 2.x never existed.', 'pods' ); ?></p>
87 <p><?php _e( '<strong>Please Note:</strong> This does not remove any items from any Post Types, Taxonomies, Media, Users, or Comments data you have added/modified.', 'pods' ); ?></p>
88
89 <p class="submit">
90 <?php $confirm = __( "Are you sure you want to do this?\n\nThis is a good time to make sure you have a backup. We are deleting all of the data that surrounds 2.x with no turning back.", 'pods' ); ?>
91 <input type="submit" class="button button-primary" name="pods_reset_deactivate" value=" <?php esc_attr_e( 'Deactivate and Delete Pods 2.x data', 'pods' ); ?> " onclick="return confirm( '<?php echo esc_js( $confirm ); ?>' );" />
92 </p>
93 <?php
94 } else {
95 ?>
96 <h3><?php esc_html_e( 'Reset Pods', 'pods' ); ?></h3>
97
98 <p><?php esc_html_e( 'This will reset Pods settings, remove all of your Pod configurations, and perform a fresh install.', 'pods' ); ?></p>
99 <h4><?php esc_html_e( 'What you can expect', 'pods' ); ?></h4>
100 <ul>
101 <li>🆗 &nbsp;&nbsp;<strong><?php esc_html_e( 'KEEP', 'pods' ); ?>:</strong> <?php esc_html_e( 'All posts will remain', 'pods' ); ?></li>
102 <li>🆗 &nbsp;&nbsp;<strong><?php esc_html_e( 'KEEP', 'pods' ); ?>:</strong> <?php esc_html_e( 'All terms will remain', 'pods' ); ?></li>
103 <li>🆗 &nbsp;&nbsp;<strong><?php esc_html_e( 'KEEP', 'pods' ); ?>:</strong> <?php esc_html_e( 'All media will remain', 'pods' ); ?></li>
104 <li>🆗 &nbsp;&nbsp;<strong><?php esc_html_e( 'KEEP', 'pods' ); ?>:</strong> <?php esc_html_e( 'All users will remain', 'pods' ); ?></li>
105 <li>🆗 &nbsp;&nbsp;<strong><?php esc_html_e( 'KEEP', 'pods' ); ?>:</strong> <?php esc_html_e( 'All custom field values will remain', 'pods' ); ?></li>
106 <li>🆗 &nbsp;&nbsp;<strong><?php esc_html_e( 'KEEP', 'pods' ); ?>:</strong> <?php esc_html_e( 'Pods plugin will remain activated', 'pods' ); ?></li>
107 <li> &nbsp;&nbsp;<strong><?php esc_html_e( 'DELETE', 'pods' ); ?>:</strong> <?php esc_html_e( 'Pods settings will be reset to defaults', 'pods' ); ?></li>
108 <li> &nbsp;&nbsp;<strong><?php esc_html_e( 'DELETE', 'pods' ); ?>:</strong> <?php esc_html_e( 'All Pod configurations will be deleted including Custom Post Types, Custom Taxonomies, Custom Settings Pages, and all custom field configurations', 'pods' ); ?></li>
109 <li> &nbsp;&nbsp;<strong><?php esc_html_e( 'DELETE', 'pods' ); ?>:</strong> <?php
110 // translators: %s is the name of the wp_podsrel table in the database.
111 printf( esc_html__( 'Relationship table (%s) will be deleted (and all of the relationships)', 'pods' ), esc_html( $relationship_table ) );
112 ?></li>
113 <li> &nbsp;&nbsp;<strong><?php esc_html_e( 'DELETE', 'pods' ); ?>:</strong> <?php esc_html_e( 'Advanced Content Type tables will be deleted (and all of their data)', 'pods' ); ?></li>
114 </ul>
115
116 <p class="submit">
117 <?php $confirm = __( "Are you sure you want to do this?\n\nThis is a good time to make sure you have a backup. We are deleting all of the data that surrounds Pods, resetting it to a clean, first install.", 'pods' ); ?>
118 <input type="submit" class="button button-primary" name="pods_reset" value="<?php esc_attr_e( 'Reset Pods settings and data', 'pods' ); ?> " onclick="return confirm( '<?php echo esc_js( $confirm ); ?>' );" />
119 </p>
120
121 <hr />
122
123 <h3><?php esc_html_e( 'Deactivate and Delete Pods data', 'pods' ); ?></h3>
124
125 <p><?php esc_html_e( 'This will delete Pods settings, data, and deactivate itself once done.', 'pods' ); ?></p>
126 <h4><?php esc_html_e( 'What you can expect', 'pods' ); ?></h4>
127 <ul>
128 <li>🆗 &nbsp;&nbsp;<strong><?php esc_html_e( 'KEEP', 'pods' ); ?>:</strong> <?php esc_html_e( 'All posts will remain', 'pods' ); ?></li>
129 <li>🆗 &nbsp;&nbsp;<strong><?php esc_html_e( 'KEEP', 'pods' ); ?>:</strong> <?php esc_html_e( 'All terms will remain', 'pods' ); ?></li>
130 <li>🆗 &nbsp;&nbsp;<strong><?php esc_html_e( 'KEEP', 'pods' ); ?>:</strong> <?php esc_html_e( 'All media will remain', 'pods' ); ?></li>
131 <li>🆗 &nbsp;&nbsp;<strong><?php esc_html_e( 'KEEP', 'pods' ); ?>:</strong> <?php esc_html_e( 'All users will remain', 'pods' ); ?></li>
132 <li>🆗 &nbsp;&nbsp;<strong><?php esc_html_e( 'KEEP', 'pods' ); ?>:</strong> <?php esc_html_e( 'All custom field values will remain', 'pods' ); ?></li>
133 <li> &nbsp;&nbsp;<strong><?php esc_html_e( 'DEACTIVATE', 'pods' ); ?>:</strong> <?php esc_html_e( 'Pods plugin will be deactivated', 'pods' ); ?></li>
134 <li> &nbsp;&nbsp;<strong><?php esc_html_e( 'DELETE', 'pods' ); ?>:</strong> <?php esc_html_e( 'Pods settings will be reset to defaults', 'pods' ); ?></li>
135 <li> &nbsp;&nbsp;<strong><?php esc_html_e( 'DELETE', 'pods' ); ?>:</strong> <?php esc_html_e( 'All Pod configurations will be deleted including Custom Post Types, Custom Taxonomies, Custom Settings Pages, and all custom field configurations', 'pods' ); ?></li>
136 <li> &nbsp;&nbsp;<strong><?php esc_html_e( 'DELETE', 'pods' ); ?>:</strong> <?php
137 // translators: %s is the name of the wp_podsrel table in the database.
138 printf( esc_html__( 'Relationship table (%s) will be deleted (and all of the relationships)', 'pods' ), esc_html( $relationship_table ) );
139 ?></li>
140 <li> &nbsp;&nbsp;<strong><?php esc_html_e( 'DELETE', 'pods' ); ?>:</strong> <?php esc_html_e( 'Advanced Content Type tables will be deleted (and all of their data)', 'pods' ); ?></li>
141 </ul>
142
143 <p class="submit">
144 <?php $confirm = __( "Are you sure you want to do this?\n\nThis is a good time to make sure you have a backup. We are deleting all of the data that surrounds with no turning back.", 'pods' ); ?>
145 <input type="submit" class="button button-primary" name="pods_reset_deactivate" value=" <?php esc_attr_e( 'Deactivate and Delete Pods data', 'pods' ); ?> " onclick="return confirm( '<?php echo esc_js( $confirm ); ?>' );" />
146 </p>
147
148 <hr />
149
150 <h3><?php esc_html_e( 'Recreate missing tables', 'pods' ); ?></h3>
151
152 <p><?php esc_html_e( 'This will recreate missing tables if there are any that do not exist.', 'pods' ); ?></p>
153 <h4><?php esc_html_e( 'What you can expect', 'pods' ); ?></h4>
154 <ul>
155 <li>🆗 &nbsp;&nbsp;<strong><?php esc_html_e( 'KEEP', 'pods' ); ?>:</strong> <?php
156 // translators: %s is the name of the wp_podsrel table in the database.
157 printf( esc_html__( '%s will remain untouched if it already exists', 'pods' ), esc_html( $relationship_table ) );
158 ?></li>
159 <li>🆗 &nbsp;&nbsp;<strong><?php esc_html_e( 'CREATE', 'pods' ); ?>:</strong> <?php
160 // translators: %s is the name of the wp_podsrel table in the database.
161 printf( esc_html__( '%s will be created if it does not exist', 'pods' ), esc_html( $relationship_table ) );
162 ?></li>
163 </ul>
164
165 <p class="submit">
166 <?php $confirm = __( "Are you sure you want to do this?", 'pods' ); ?>
167 <input type="submit" class="button button-primary" name="pods_recreate_tables" value=" <?php esc_attr_e( 'Recreate missing tables', 'pods' ); ?> " onclick="return confirm( '<?php echo esc_js( $confirm ); ?>' );" />
168 </p>
169 <?php
170 }//end if
171
172 if ( $monday_mode ) {
173 ?>
174 <hr />
175
176 <h3><?php esc_html_e( 'Reset Weekend', 'pods' ); ?></h3>
177
178 <p><?php esc_html_e( 'This feature has been exclusively built for Pods to help developers suffering from "Monday", and allows them to reset the weekend.', 'pods' ); ?></p>
179 <p><?php esc_html_e( "By resetting the weekend, you will be sent back to Friday night and the weekend you've just spent will be erased. You will retain all of your memories of the weekend, and be able to relive it in any way you wish.", 'pods' ); ?></p>
180
181 <p class="submit">
182 <?php $confirm = __( "Are you sure you want to Reset your Weekend?\n\nThere is no going back, you cannot reclaim anything you've gained throughout your weekend.\n\nYou are about to be groundhoggin' it", 'pods' ); ?>
183 <input type="submit" class="button button-primary" name="pods_reset_weekend" value=" reset_weekend( '<?php echo esc_js( date_i18n( 'Y-m-d', strtotime( '-3 days' ) ) ); ?> 19:00:00' ); " onclick="return confirm( '<?php echo esc_js( $confirm ); ?>' );" />
184 </p>
185 <?php
186 }
187 ?>
188