PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 2.0.4
Adminify – White Label, Admin Menu Editor, Login Customizer v2.0.4
4.3.2 4.3.1 4.3.0 4.2.26 4.2.25 4.2.24 4.2.23 4.2.22 4.2.21 4.2.20 4.2.19 4.2.18 4.2.17 4.2.16 4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 All 165 releases
← All changes | Inc/Admin/Options/RollbackVersion.php +167 -172 4.2.82.0.4 View file →
@@ -1,52 +1,53 @@
1 1 <?php
2 2
3 -namespace PXLBSAdminify\Inc\Admin\Options;
3 +namespace WPAdminify\Inc\Admin\Options;
4 4
5 -use PXLBSAdminify\Inc\Utils;
6 -use PXLBSAdminify\Inc\Classes\Helper;
7 -use PXLBSAdminify\Inc\Classes\Adminify_Rollback;
5 +use WPAdminify\Inc\Utils;
6 +use WPAdminify\Inc\Classes\Adminify_Rollback;
8 7
9 -if ( ! defined( 'ABSPATH' ) ) {
10 - die;
8 +if (!defined('ABSPATH')) {
9 + die;
11 10 } // Cannot access directly.
12 11
13 -class RollbackVersion {
12 +class RollbackVersion
13 +{
14 + private $prefix;
15 + public function __construct()
16 + {
14 17
15 - private $prefix;
16 - public function __construct() {
17 - if ( is_multisite() && ! is_network_admin() ) {
18 - return; // only display to network admin if multisite is enbaled
19 - }
18 + if ( is_multisite() && ! is_network_admin() ) return; // only display to network admin if multisite is enbaled
20 19
21 - $this->prefix = '_adminify_rollback';
22 - $this->pxlbsadminify_rollback_options();
20 + $this->prefix = '_adminify_rollback';
21 + $this->jltwp_adminify_rollback_options();
23 22
24 - add_action( 'admin_enqueue_scripts', [ $this, 'pxlbsadminify_rollback_enqueue_scripts' ] );
25 - }
23 + add_action('admin_enqueue_scripts', [$this, 'jltwp_adminify_rollback_enqueue_scripts']);
24 + }
26 25
27 - public function get_defaults() {
28 - return [
29 - 'adminify_rollback' => '',
30 - ];
31 - }
26 + public function get_defaults()
27 + {
28 + return [
29 + 'adminify_rollback' => ''
30 + ];
31 + }
32 32
33 - /**
34 - * Scripts/Styles
35 - */
36 - public function pxlbsadminify_rollback_enqueue_scripts() {
37 - global $pagenow;
33 + /**
34 + * Scripts/Styles
35 + */
36 + public function jltwp_adminify_rollback_enqueue_scripts()
37 + {
38 + global $pagenow;
38 39
39 - // Load Scripts/Styles only WP Adminify Custom CSS/JS Page
40 - // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only check, no state change.
41 - if ( ! empty( $_GET['page'] ) && ( 'admin.php' === $pagenow ) && ( 'adminify-rollback-version' === sanitize_key( wp_unslash( $_GET['page'] ) ) ) ) {
42 - $this->version_rollback_admin_script();
43 - }
44 - }
40 + // Load Scripts/Styles only WP Adminify Custom CSS/JS Page
41 + if (('admin.php' === $pagenow) && ('adminify-rollback-version' === $_GET['page'])) {
42 + $this->version_rollback_admin_script();
43 + }
44 + }
45 45
46 46
47 - public function version_rollback_admin_script() {
48 - $rollback_custom_admin_styles = '.adminify-rollback-version .adminify-container{ max-width:60%; margin:0 auto;} .adminify-rollback-version .adminify-header{display:none ;}
47 + public function version_rollback_admin_script()
48 + {
49 + echo '<style>.adminify-rollback-version .adminify-container{ max-width:60%; margin:0 auto;} .adminify-rollback-version .adminify-header{display:none ;}
49 50 .adminify-rollback-version .adminify-header-inner{padding:0;}.adminify-rollback-version .adminify-field-subheading{font-size:20px; padding-left:0;} .adminify-rollback-version .adminify-nav,.adminify-rollback-version .adminify-search,.adminify-rollback-version .adminify-footer,.adminify-rollback-version .adminify-reset-all,.adminify-rollback-version .adminify-expand-all,.adminify-rollback-version .adminify-header-left,.adminify-rollback-version .adminify-reset-section,.adminify-rollback-version .adminify-nav-background{display: none !important;}.adminify-rollback-version .adminify-nav-normal + .adminify-content{margin-left: 0;}
50 51 /* If needed for white top-bar */
51 52 .adminify-rollback-version .adminify-header-inner {
52 53 background-color: #fafafa !important;
@@ -51,176 +52,170 @@
51 52 .adminify-rollback-version .adminify-header-inner {
52 53 background-color: #fafafa !important;
53 54 border-bottom: 1px solid #f5f5f5;
54 55 }
55 - .adminify-rollback-version .adminify-field-callback a.dashicons{ width: inherit; }';
56 + .adminify-rollback-version .adminify-field-callback a.dashicons{ width: inherit; }
57 + </style>';
58 + }
56 59
57 - echo '<style>' . esc_html( wp_strip_all_tags( $rollback_custom_admin_styles ) ) . '</style>';
58 - }
59 60
61 + public static function jltwp_adminify_rollback_contents()
62 + { ?>
60 63
61 - public static function pxlbsadminify_rollback_contents() { ?>
64 + <div class="border border-muted">
62 65
63 - <div class="border border-muted">
66 + <h3><?php echo __('Rollback Version', WP_ADMINIFY_TD); ?></h3>
64 67
65 - <h3><?php echo esc_html__( 'Rollback Version', 'adminify' ); ?></h3>
66 68
69 + <?php
70 + $rollback_html = '<select class="wp-adminify-rollback-select">';
71 + $ger_versions = Adminify_Rollback::get_instance();
67 72
68 - <?php
69 - $rollback_html = '<select class="wp-adminify-rollback-select">';
70 - $ger_versions = Adminify_Rollback::get_instance();
73 + foreach ($ger_versions->get_rollback_versions() as $version) {
74 + $rollback_html .= "<option value='{$version}'>$version</option>";
75 + }
76 + $rollback_html .= '</select>';
77 + echo $rollback_html;
71 78
72 - foreach ( $ger_versions->get_rollback_versions() as $version ) {
73 - $rollback_html .= "<option value='{$version}'>$version</option>";
74 - }
75 - $rollback_html .= '</select>';
76 - echo Utils::kses_custom( $rollback_html ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- kses_custom() is a wp_kses() wrapper; output already escaped.
79 + echo sprintf('<a data-placeholder-text="' . esc_html__('Reinstall', WP_ADMINIFY_VER) . ' v{VERSION}" href="#" data-placeholder-url="%s" class="button button-primary wp-adminify-btn wp-adminify-rollback-button dashicons dashicons-update-alt ml-2">%s</a>', wp_nonce_url(admin_url('admin-post.php?action=wp_adminify_rollback_version&version=VERSION'), 'wp_adminify_rollback_version'), __('Reinstall', WP_ADMINIFY_VER));
80 + ?>
81 + <p class="wp-adminify-roll-desc pt-2 has-text-danger">
82 + <?php echo __('Warning: Please backup your database before making the rollback.', WP_ADMINIFY_TD); ?>
83 + </p>
84 + </div>
77 85
78 - echo sprintf(
79 - wp_kses_post( '<a data-placeholder-text="%1$s" href="#" data-placeholder-url="%2$s" class="button button-primary wp-adminify-btn wp-adminify-rollback-button dashicons dashicons-update-alt ml-2">%3$s</a>' ),
80 - esc_html__( 'Reinstall', 'adminify' ) . ' v' . esc_html( PXLBSADMINIFY_VER ),
81 - esc_url( wp_nonce_url( admin_url( 'admin-post.php?action=pxlbsadminify_rollback_version&version=VERSION' ), 'pxlbsadminify_rollback_version' ) ),
82 - esc_html__( 'Reinstall', 'adminify' )
83 - );
84 - ?>
85 - <p class="wp-adminify-roll-desc pt-2 has-text-danger">
86 - <?php echo esc_html__( 'Warning: Please backup your database before making the rollback.', 'adminify' ); ?>
87 - </p>
88 - </div>
89 86
87 + <div class="wp-adminify--popup-area is-flex is-align-items-center is-justify-content-center">
88 + <div class="wp-adminify--popup-container has-text-centered">
89 + <div class="wp-adminify--popup-container_inner pt-6 pb-6">
90 + <div class="wp-adminify-popup-header">
91 + <?php echo __('Rollback to Previous Version', WP_ADMINIFY_TD); ?>
92 + </div>
93 + <div class="wp-adminify-dialog-message wp-adminify-dialog-confirm-message slow">
94 + <?php echo __('Are you sure you want to reinstall previous version?', WP_ADMINIFY_TD); ?>
95 + </div>
96 + <div class="wp-adminify-dialog-buttons-wrapper wp-adminify-dialog-confirm-buttons-wrapper mt-5">
97 + <button class="wp-adminify-dialog-button button-secondary wp-adminify-dialog-cancel wp-adminify-dialog-confirm-cancel">
98 + <?php echo __('Cancel', WP_ADMINIFY_TD); ?>
99 + </button>
100 + <button class="wp-adminify-dialog-button button-primary wp-adminify-dialog-ok wp-adminify-dialog-confirm-ok">
101 + <?php echo __('Continue', WP_ADMINIFY_TD); ?>
102 + </button>
103 + </div>
104 + </div>
105 + </div>
106 + </div>
90 107
91 - <div class="wp-adminify--popup-area is-flex is-align-items-center is-justify-content-center">
92 - <div class="wp-adminify--popup-container has-text-centered">
93 - <div class="wp-adminify--popup-container_inner pt-6 pb-6">
94 - <div class="wp-adminify-popup-header">
95 - <?php echo esc_html__( 'Rollback to Previous Version', 'adminify' ); ?>
96 - </div>
97 - <div class="wp-adminify-dialog-message wp-adminify-dialog-confirm-message slow">
98 - <?php echo esc_html__( 'Are you sure you want to reinstall previous version?', 'adminify' ); ?>
99 - </div>
100 - <div class="wp-adminify-dialog-buttons-wrapper wp-adminify-dialog-confirm-buttons-wrapper mt-5">
101 - <button class="wp-adminify-dialog-button button-secondary wp-adminify-dialog-cancel wp-adminify-dialog-confirm-cancel">
102 - <?php echo esc_html__( 'Cancel', 'adminify' ); ?>
103 - </button>
104 - <button class="wp-adminify-dialog-button button-primary wp-adminify-dialog-ok wp-adminify-dialog-confirm-ok">
105 - <?php echo esc_html__( 'Continue', 'adminify' ); ?>
106 - </button>
107 - </div>
108 - </div>
109 - </div>
110 - </div>
111 108
112 109
113 110
111 +<?php }
114 112
115 - <?php
116 - }
117 113
114 + public function jltwp_adminify_rollback_fields(&$fields)
115 + {
116 + $fields[] = array(
117 + 'type' => 'subheading',
118 + 'content' => Utils::adminfiy_help_urls(
119 + __('Rollback to Previous Version', WP_ADMINIFY_TD),
120 + 'https://wpadminify.com/kb/version-rollback/',
121 + 'https://www.youtube.com/playlist?list=PLqpMw0NsHXV-EKj9Xm1DMGa6FGniHHly8',
122 + 'https://www.facebook.com/groups/jeweltheme',
123 + 'https://wpadminify.com/support/'
124 + )
125 + );
118 126
119 - public function pxlbsadminify_rollback_fields( &$fields ) {
120 - $fields[] = [
121 - 'type' => 'subheading',
122 - 'content' => Utils::help_urls(
123 - __( 'Rollback to Previous Version', 'adminify' ),
124 - 'https://wpadminify.com/kb/version-rollback/',
125 - 'https://www.youtube.com/playlist?list=PLqpMw0NsHXV-EKj9Xm1DMGa6FGniHHly8',
126 - 'https://www.facebook.com/groups/jeweltheme',
127 - \PXLBSAdminify\Inc\Admin\AdminSettings::support_url()
128 - ),
129 - ];
127 + $fields[] = array(
128 + 'type' => 'submessage',
129 + 'style' => 'info',
130 + 'content' => sprintf(__('<strong>Experiencing an issue with %1$s <em>v%2$s</em>? Rollback to a previous version before the issue appeared.</strong>', WP_ADMINIFY_TD), WP_ADMINIFY, WP_ADMINIFY_VER),
131 + );
130 132
131 - $fields[] = [
132 - 'type' => 'submessage',
133 - 'style' => 'info',
134 - /* translators: %1$s: plugin name, %2$s: plugin version */
135 - 'content' => '<strong>' . sprintf( __( 'Experiencing an issue with %1$s <em>v%2$s</em>? Rollback to a previous version before the issue appeared.', 'adminify' ), esc_html( PXLBSADMINIFY ), esc_html( PXLBSADMINIFY_VER ) ) . '</strong>',
136 - ];
133 + $fields[] = array(
134 + 'id' => 'adminify_rollback',
135 + 'type' => 'callback',
136 + 'function' => '\WPAdminify\Inc\Admin\Options\RollbackVersion::jltwp_adminify_rollback_contents',
137 + );
138 + }
137 139
138 - $fields[] = [
139 - 'id' => 'adminify_rollback',
140 - 'type' => 'callback',
141 - 'function' => '\PXLBSAdminify\Inc\Admin\Options\RollbackVersion::pxlbsadminify_rollback_contents',
142 - ];
143 - }
140 + public function jltwp_adminify_rollback_options()
141 + {
142 + if (!class_exists('ADMINIFY')) {
143 + return;
144 + }
144 145
145 - public function pxlbsadminify_rollback_options() {
146 - if ( ! class_exists( 'ADMINIFY' ) ) {
147 - return;
148 - }
146 + // WP Adminify Custom Header & Footer Options
147 + \ADMINIFY::createOptions($this->prefix, array(
149 148
150 - // WP Adminify Custom Header & Footer Options
151 - \ADMINIFY::createOptions(
152 - $this->prefix,
153 - [
149 + // Framework Title
150 + 'framework_title' => 'Rollback Version <small>for WP Adminify</small>',
151 + 'framework_class' => 'adminify-rollback-version',
154 152
155 - // Framework Title
156 - 'framework_title' => __( 'Rollback Version <small>for Adminify</small>', 'adminify' ),
157 - 'framework_class' => 'adminify-rollback-version',
153 + // menu settings
154 + 'menu_title' => 'Rollback Version',
155 + 'menu_slug' => 'adminify-rollback-version',
156 + 'menu_type' => 'submenu', // menu, submenu, options, theme, etc.
157 + 'menu_capability' => 'manage_options',
158 + 'menu_icon' => '',
159 + 'menu_position' => 54,
160 + 'menu_hidden' => false,
161 + 'menu_parent' => 'wp-adminify-settings',
158 162
159 - // menu settings
160 - 'menu_title' => __( 'Rollback Version', 'adminify' ),
161 - 'menu_slug' => 'adminify-rollback-version',
162 - 'menu_type' => 'submenu', // menu, submenu, options, theme, etc.
163 - 'menu_capability' => 'manage_options',
164 - 'menu_icon' => '',
165 - 'menu_position' => 54,
166 - 'menu_hidden' => false,
167 - 'menu_parent' => 'wp-adminify-settings',
163 + // footer
164 + 'footer_text' => ' ',
165 + 'footer_after' => ' ',
166 + 'footer_credit' => ' ',
168 167
169 - // footer
170 - 'footer_text' => ' ',
171 - 'footer_after' => ' ',
172 - 'footer_credit' => ' ',
168 + // menu extras
169 + 'show_bar_menu' => false,
170 + 'show_sub_menu' => false,
171 + 'show_in_network' => true,
172 + 'show_in_customizer' => false,
173 173
174 - // menu extras
175 - 'show_bar_menu' => false,
176 - 'show_sub_menu' => false,
177 - 'show_in_network' => true,
178 - 'show_in_customizer' => false,
174 + 'show_search' => false,
175 + 'show_reset_all' => false,
176 + 'show_reset_section' => false,
177 + 'show_header' => false,
178 + 'show_footer' => false,
179 + 'show_all_options' => false,
180 + 'show_form_warning' => false,
181 + 'sticky_header' => false,
182 + 'save_defaults' => false,
183 + 'ajax_save' => false,
179 184
180 - 'show_search' => false,
181 - 'show_reset_all' => false,
182 - 'show_reset_section' => false,
183 - 'show_header' => false,
184 - 'show_footer' => false,
185 - 'show_all_options' => false,
186 - 'show_form_warning' => false,
187 - 'sticky_header' => false,
188 - 'save_defaults' => false,
189 - 'ajax_save' => false,
185 + // admin bar menu settings
186 + 'admin_bar_menu_icon' => '',
187 + 'admin_bar_menu_priority' => 45,
190 188
191 - // admin bar menu settings
192 - 'admin_bar_menu_icon' => '',
193 - 'admin_bar_menu_priority' => 45,
194 189
195 - // database model
196 - 'database' => 'network', // options, transient, theme_mod, network(multisite support)
197 - 'transient_time' => 0,
190 + // database model
191 + 'database' => 'network', // options, transient, theme_mod, network(multisite support)
192 + 'transient_time' => 0,
198 193
199 - // typography options
200 - 'enqueue_webfont' => false,
201 - 'async_webfont' => false,
202 194
203 - // others
204 - 'output_css' => false,
195 + // typography options
196 + 'enqueue_webfont' => false,
197 + 'async_webfont' => false,
205 198
206 - // theme and wrapper classname
207 - 'nav' => 'normal',
208 - 'theme' => 'dark',
209 - 'class' => 'wp-adminify-rollback',
210 - ]
211 - );
199 + // others
200 + 'output_css' => false,
212 201
213 - $fields = [];
214 - $this->pxlbsadminify_rollback_fields( $fields );
202 + // theme and wrapper classname
203 + 'nav' => 'normal',
204 + 'theme' => 'dark',
205 + 'class' => 'wp-adminify-rollback',
206 + ));
215 207
216 - // Rollback Section
217 - \ADMINIFY::createSection(
218 - $this->prefix,
219 - [
220 - 'title' => __( 'Rollback Version', 'adminify' ),
221 - 'icon' => 'fas fa-layer-group',
222 - 'fields' => $fields,
223 - ]
224 - );
225 - }
208 +
209 +
210 + $fields = [];
211 + $this->jltwp_adminify_rollback_fields($fields);
212 +
213 +
214 + // Rollback Section
215 + \ADMINIFY::createSection($this->prefix, array(
216 + 'title' => __('Rollback Version', WP_ADMINIFY_TD),
217 + 'icon' => 'fas fa-layer-group',
218 + 'fields' => $fields
219 + ));
220 + }
226 221 }