PluginProbe
Meow Gallery / 4.2.2
Meow Gallery v4.2.2
5.5.5 5.5.4 5.5.3 5.5.2 5.5.1 5.5.0 5.4.9 5.4.8 5.4.7 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 All 157 releases
← All changes | common/admin.php +23 -20 4.1.5 → 4.2.2 View file →
@@ -4,10 +4,10 @@
4 4
5 5 class MeowCommon_Admin {
6 6
7 7 public static $loaded = false;
8 - public static $version = "3.3";
9 - public static $admin_version = "3.3";
8 + public static $version = "3.6";
9 + public static $admin_version = "3.6";
10 10
11 11 public $prefix; // prefix used for actions, filters (mfrh)
12 12 public $mainfile; // plugin main file (media-file-renamer.php)
13 13 public $domain; // domain used for translation (media-file-renamer)
@@ -20,9 +20,9 @@
20 20 if ( !MeowCommon_Admin::$loaded ) {
21 21 if ( is_admin() ) {
22 22
23 23 // Check potential issues with this WordPress install, other plugins, etc.
24 - new MeowCommon_Classes_Issues( $prefix, $mainfile, $domain );
24 + new MeowCommon_Issues( $prefix, $mainfile, $domain );
25 25
26 26 // Create the Meow Apps Menu
27 27 add_action( 'admin_menu', array( $this, 'admin_menu_start' ) );
28 28 if ( isset( $_GET['page'] ) && $_GET['page'] === 'meowapps-main-menu' ) {
@@ -44,9 +44,9 @@
44 44 if ( !empty( $license ) && !$this->isPro ) {
45 45 add_action( 'admin_notices', array( $this, 'admin_notices_licensed_free' ) );
46 46 }
47 47 if ( !$disableReview ) {
48 - new MeowCommon_Classes_Ratings( $prefix, $mainfile, $domain );
48 + new MeowCommon_Ratings( $prefix, $mainfile, $domain );
49 49 }
50 50 }
51 51 add_filter( 'plugin_row_meta', array( $this, 'custom_plugin_row_meta' ), 10, 2 );
52 52 add_filter( 'edd_sl_api_request_verify_ssl', array( $this, 'request_verify_ssl' ), 10, 0 );
@@ -97,21 +97,21 @@
97 97 delete_option( $this->prefix . '_pro_serial' );
98 98 delete_option( $this->prefix . '_license' );
99 99 return;
100 100 }
101 - echo '<div class="notice notice-error">';
102 - printf(
101 + $html = '<div class="notice notice-error">';
102 + $html .= sprintf(
103 103 __( '<p>It looks like you are using the free version of the plugin (<b>%s</b>) but a license for the Pro version was also found. The Pro version might have been replaced by the Free version during an update (might be caused by a temporarily issue). If it is the case, <b>please download it again</b> from the <a target="_blank" href="https://store.meowapps.com">Meow Store</a>. If you wish to continue using the free version and clear this message, click on this button.', $this->domain ),
104 104 $this->nice_name_from_file( $this->mainfile ) );
105 - echo '<p>
105 + $html .= '<p>
106 106 <form method="post" action="">
107 107 <input type="hidden" name="' . $this->prefix . '_reset_sub" value="true">
108 108 <input type="submit" name="submit" id="submit" class="button" value="'
109 109 . __( 'Remove the license', $this->domain ) . '">
110 110 </form>
111 - </p>
112 - ';
113 - echo '</div>';
111 + </p>';
112 + $html .= '</div>';
113 + wp_kses_post( $html );
114 114 }
115 115
116 116 function admin_menu_start() {
117 117 // Hide the admin if user doesn't like Meow much
@@ -135,9 +135,9 @@
135 135 function meowapps_hide_dashboard_callback() {
136 136 $html = '<input type="checkbox" id="meowapps_hide_meowapps" name="meowapps_hide_meowapps" value="1" ' .
137 137 checked( 1, get_option( 'meowapps_hide_meowapps' ), false ) . '/>';
138 138 $html .= __( '<label>Hide <b>Meow Apps</b> Menu</label><br /><small>Hide Meow Apps menu and all its components, for a cleaner admin. This option will be reset if a new Meow Apps plugin is installed. <b>Once activated, an option will be added in your General settings to display it again.</b></small>', $this->domain );
139 - echo $html;
139 + echo wp_kses_post( $html );
140 140 }
141 141
142 142 function is_registered() {
143 143 return apply_filters( $this->prefix . '_meowapps_is_registered', false, $this->prefix );
@@ -143,22 +143,27 @@
143 143 return apply_filters( $this->prefix . '_meowapps_is_registered', false, $this->prefix );
144 144 }
145 145
146 146 function get_phpinfo() {
147 + if ( !current_user_can( 'administrator' ) ) {
148 + return;
149 + }
147 150 ob_start();
151 + // phpcs:disable WordPress.PHP.DevelopmentFunctions
148 152 phpinfo( INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES );
153 + // phpcs:enable
149 154 $html = ob_get_contents();
150 155 ob_end_clean();
151 156 $html = preg_replace( '%^.*<body>(.*)</body>.*$%ms','$1', $html );
152 - echo $html;
157 + return $html;
153 158 }
154 -
159 +
155 160 function admin_meow_apps() {
156 - echo "<div id='meow-common-dashboard'></div>";
157 -
158 - echo "<div style='display: none;' id='meow-common-phpinfo'>";
159 - echo $this->get_phpinfo();
160 - echo "</div>";
161 + $html = "<div id='meow-common-dashboard'></div>";
162 + $html .= "<div style='height: 0; width: 0; overflow: hidden;' id='meow-common-phpinfo'>";
163 + $html .= $this->get_phpinfo();
164 + $html .= "</div>";
165 + echo wp_kses_post( $html );
161 166 }
162 167
163 168 function admin_footer_text( $current ) {
164 169 return sprintf(
@@ -169,6 +174,4 @@
169 174 );
170 175 }
171 176 }
172 177 }
173 -
174 -?>