| @@ -1,6 +1,11 @@ | ||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; | |
| 2 | +if (defined('ABSPATH') === false) { | |
| 3 | + exit; | |
| 4 | +} | |
| 5 | + | |
| 6 | +?> | |
| 7 | +<?php | |
| 3 | 8 | require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; |
| 4 | 9 | remove_all_filters('plugins_api'); |
| 5 | 10 | $qcld_chatplugintags = array( |
| 6 | 11 | 'a' => array( |
| @@ -62,17 +67,17 @@ | ||
| 62 | 67 | } |
| 63 | 68 | $title = wp_kses( $plugin['name'], $qcld_chatplugintags ); |
| 64 | 69 | |
| 65 | 70 | // Remove any HTML from the description. |
| 66 | - $description = wp_strip_all_tags( $plugin['short_description'] ); | |
| 71 | + $description = strip_tags( $plugin['short_description'] ); | |
| 67 | 72 | $version = wp_kses( $plugin['version'], $qcld_chatplugintags ); |
| 68 | 73 | |
| 69 | - $name = wp_strip_all_tags( $title . ' ' . $version ); | |
| 74 | + $name = strip_tags( $title . ' ' . $version ); | |
| 70 | 75 | |
| 71 | 76 | $author = wp_kses( $plugin['author'], $qcld_chatplugintags ); |
| 72 | 77 | if ( ! empty( $author ) ) { |
| 73 | 78 | /* translators: %s: Plugin author. */ |
| 74 | - $author = ' <cite>' . sprintf( __( 'By %s', 'chatbot' ), $author ) . '</cite>'; | |
| 79 | + $author = ' <cite>' . sprintf( __( 'By %s' ), $author ) . '</cite>'; | |
| 75 | 80 | } |
| 76 | 81 | |
| 77 | 82 | $requires_php = isset( $plugin['requires_php'] ) ? $plugin['requires_php'] : null; |
| 78 | 83 | $requires_wp = isset( $plugin['requires'] ) ? $plugin['requires'] : null; |
| @@ -94,17 +99,16 @@ | ||
| 94 | 99 | '<a class="install-now button" data-slug="%s" href="%s" aria-label="%s" data-name="%s">%s</a>', |
| 95 | 100 | esc_attr( $plugin['slug'] ), |
| 96 | 101 | esc_url( $status['url'] ), |
| 97 | 102 | /* translators: %s: Plugin name and version. */ |
| 98 | - esc_attr( sprintf( _x( 'Install %s now', 'Install plugin', 'chatbot' ), $name ) ), | |
| 99 | - | |
| 103 | + esc_attr( sprintf( _x( 'Install %s now', 'plugin' ), $name ) ), | |
| 100 | 104 | esc_attr( $name ), |
| 101 | - __( 'Install Now', 'chatbot' ) | |
| 105 | + __( 'Install Now' ) | |
| 102 | 106 | ); |
| 103 | 107 | } else { |
| 104 | 108 | $action_links[] = sprintf( |
| 105 | 109 | '<button type="button" class="button button-disabled" disabled="disabled">%s</button>', |
| 106 | - __( 'Cannot Install', 'chatbot' ) | |
| 110 | + _x( 'Cannot Install', 'plugin' ) | |
| 107 | 111 | ); |
| 108 | 112 | } |
| 109 | 113 | } |
| 110 | 114 | break; |
| @@ -117,17 +121,16 @@ | ||
| 117 | 121 | esc_attr( $status['file'] ), |
| 118 | 122 | esc_attr( $plugin['slug'] ), |
| 119 | 123 | esc_url( $status['url'] ), |
| 120 | 124 | /* translators: %s: Plugin name and version. */ |
| 121 | - esc_attr( sprintf( _x( 'Update %s now', 'Update plugin', 'chatbot' ), $name ) ), | |
| 122 | - | |
| 125 | + esc_attr( sprintf( _x( 'Update %s now', 'plugin' ), $name ) ), | |
| 123 | 126 | esc_attr( $name ), |
| 124 | - __( 'Update Now', 'chatbot' ) | |
| 127 | + __( 'Update Now' ) | |
| 125 | 128 | ); |
| 126 | 129 | } else { |
| 127 | 130 | $action_links[] = sprintf( |
| 128 | 131 | '<button type="button" class="button button-disabled" disabled="disabled">%s</button>', |
| 129 | - __( 'Cannot Update', 'chatbot' ) | |
| 132 | + _x( 'Cannot Update', 'plugin' ) | |
| 130 | 133 | ); |
| 131 | 134 | } |
| 132 | 135 | } |
| 133 | 136 | break; |
| @@ -136,14 +139,14 @@ | ||
| 136 | 139 | case 'newer_installed': |
| 137 | 140 | if ( is_plugin_active( $status['file'] ) ) { |
| 138 | 141 | $action_links[] = sprintf( |
| 139 | 142 | '<button type="button" class="button button-disabled" disabled="disabled">%s</button>', |
| 140 | - __( 'Active', 'chatbot' ) | |
| 143 | + _x( 'Active', 'plugin' ) | |
| 141 | 144 | ); |
| 142 | 145 | } elseif ( current_user_can( 'activate_plugin', $status['file'] ) ) { |
| 143 | - $button_text = __( 'Activate', 'chatbot' ); | |
| 146 | + $button_text = __( 'Activate' ); | |
| 144 | 147 | /* translators: %s: Plugin name. */ |
| 145 | - $button_label = _x( 'Activate %s', 'plugin name', 'chatbot' ); | |
| 148 | + $button_label = _x( 'Activate %s', 'plugin' ); | |
| 146 | 149 | $activate_url = add_query_arg( |
| 147 | 150 | array( |
| 148 | 151 | '_wpnonce' => wp_create_nonce( 'activate-plugin_' . $status['file'] ), |
| 149 | 152 | 'action' => 'activate', |
| @@ -152,11 +155,11 @@ | ||
| 152 | 155 | network_admin_url( 'plugins.php' ) |
| 153 | 156 | ); |
| 154 | 157 | |
| 155 | 158 | if ( is_network_admin() ) { |
| 156 | - $button_text = __( 'Network Activate', 'chatbot' ); | |
| 159 | + $button_text = __( 'Network Activate' ); | |
| 157 | 160 | /* translators: %s: Plugin name. */ |
| 158 | - $button_label = _x( 'Network Activate %s', 'plugin name', 'chatbot' ); | |
| 161 | + $button_label = _x( 'Network Activate %s', 'plugin' ); | |
| 159 | 162 | $activate_url = add_query_arg( array( 'networkwide' => 1 ), $activate_url ); |
| 160 | 163 | } |
| 161 | 164 | |
| 162 | 165 | $action_links[] = sprintf( |
| @@ -167,9 +170,9 @@ | ||
| 167 | 170 | ); |
| 168 | 171 | } else { |
| 169 | 172 | $action_links[] = sprintf( |
| 170 | 173 | '<button type="button" class="button button-disabled" disabled="disabled">%s</button>', |
| 171 | - _x( 'Installed', 'plugin status', 'chatbot' ) | |
| 174 | + _x( 'Installed', 'plugin' ) | |
| 172 | 175 | ); |
| 173 | 176 | } |
| 174 | 177 | break; |
| 175 | 178 | } |
| @@ -178,10 +181,29 @@ | ||
| 178 | 181 | $details_link = self_admin_url( |
| 179 | 182 | 'plugin-install.php?tab=plugin-information&plugin=' . $plugin['slug'] . |
| 180 | 183 | '&width=700&height=550' |
| 181 | 184 | ); |
| 182 | - $action_links[] = sprintf( '%s','<a href="#" data-toggle="modal" data-target="#myModal">More Details</a><div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"><div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button></div><div class="modal-body"><iframe width="100%" height="550" src="'.$details_link.'"></iframe></div></div></div></div>'); | |
| 183 | - /*===show icon ==*/ | |
| 185 | + | |
| 186 | + $action_links[] = sprintf( | |
| 187 | + '%s',' | |
| 188 | + <a href="#" data-toggle="modal" data-target="#myModal">More Details</a> | |
| 189 | + <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> | |
| 190 | + <div class="modal-dialog" role="document"> | |
| 191 | + <div class="modal-content"> | |
| 192 | + <div class="modal-header"> | |
| 193 | + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | |
| 194 | + </div> | |
| 195 | + <div class="modal-body"> | |
| 196 | + <iframe width="100%" height="550" src="'.$details_link.'"></iframe> | |
| 197 | + </div> | |
| 198 | + </div> | |
| 199 | + </div> | |
| 200 | + </div>', | |
| 201 | + ); | |
| 202 | + | |
| 203 | + | |
| 204 | + /*===show icon ==*/ | |
| 205 | + | |
| 184 | 206 | if ( ! empty( $plugin['icons']['svg'] ) ) { |
| 185 | 207 | $plugin_icon_url = $plugin['icons']['svg']; |
| 186 | 208 | } elseif ( ! empty( $plugin['icons']['2x'] ) ) { |
| 187 | 209 | $plugin_icon_url = $plugin['icons']['2x']; |
| @@ -189,8 +211,9 @@ | ||
| 189 | 211 | $plugin_icon_url = $plugin['icons']['1x']; |
| 190 | 212 | } else { |
| 191 | 213 | $plugin_icon_url = $plugin['icons']['default']; |
| 192 | 214 | } |
| 215 | + | |
| 193 | 216 | /* |
| 194 | 217 | * $action_links An array of plugin action links. Defaults are links to Details and Install Now. |
| 195 | 218 | * $plugin The plugin currently being listed. |
| 196 | 219 | */ |
| @@ -202,14 +225,14 @@ | ||
| 202 | 225 | <?php |
| 203 | 226 | if ( ! $compatible_php || ! $compatible_wp ) { |
| 204 | 227 | echo '<div class="notice inline notice-error notice-alt"><p>'; |
| 205 | 228 | if ( ! $compatible_php && ! $compatible_wp ) { |
| 206 | - esc_html_e( 'This plugin doesn’t work with your versions of WordPress and PHP.', 'chatbot' ); | |
| 229 | + _e( 'This plugin doesn’t work with your versions of WordPress and PHP.' ); | |
| 207 | 230 | if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { |
| 208 | 231 | printf( |
| 209 | 232 | /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ |
| 210 | - '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.', | |
| 211 | - esc_url( self_admin_url( 'update-core.php' ) ), | |
| 233 | + ' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ), | |
| 234 | + self_admin_url( 'update-core.php' ), | |
| 212 | 235 | esc_url( wp_get_update_php_url() ) |
| 213 | 236 | ); |
| 214 | 237 | wp_update_php_annotation( '</p><p><em>', '</em>' ); |
| 215 | 238 | } elseif ( current_user_can( 'update_core' ) ) { |
| @@ -214,34 +237,34 @@ | ||
| 214 | 237 | wp_update_php_annotation( '</p><p><em>', '</em>' ); |
| 215 | 238 | } elseif ( current_user_can( 'update_core' ) ) { |
| 216 | 239 | printf( |
| 217 | 240 | /* translators: %s: URL to WordPress Updates screen. */ |
| 218 | - '<a href="%s">Please update WordPress</a>.', | |
| 219 | - esc_url( self_admin_url( 'update-core.php' ) ) | |
| 241 | + ' ' . __( '<a href="%s">Please update WordPress</a>.' ), | |
| 242 | + self_admin_url( 'update-core.php' ) | |
| 220 | 243 | ); |
| 221 | 244 | } elseif ( current_user_can( 'update_php' ) ) { |
| 222 | 245 | printf( |
| 223 | 246 | /* translators: %s: URL to Update PHP page. */ |
| 224 | - '<a href="%s">Learn more about updating PHP</a>.', | |
| 247 | + ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), | |
| 225 | 248 | esc_url( wp_get_update_php_url() ) |
| 226 | 249 | ); |
| 227 | 250 | wp_update_php_annotation( '</p><p><em>', '</em>' ); |
| 228 | 251 | } |
| 229 | 252 | } elseif ( ! $compatible_wp ) { |
| 230 | - esc_html_e( 'This plugin doesn’t work with your version of WordPress.', 'chatbot' ); | |
| 253 | + _e( 'This plugin doesn’t work with your version of WordPress.' ); | |
| 231 | 254 | if ( current_user_can( 'update_core' ) ) { |
| 232 | 255 | printf( |
| 233 | 256 | /* translators: %s: URL to WordPress Updates screen. */ |
| 234 | - '<a href="%s">Please update WordPress</a>.', | |
| 235 | - esc_url( self_admin_url( 'update-core.php' ) ) | |
| 257 | + ' ' . __( '<a href="%s">Please update WordPress</a>.' ), | |
| 258 | + self_admin_url( 'update-core.php' ) | |
| 236 | 259 | ); |
| 237 | 260 | } |
| 238 | 261 | } elseif ( ! $compatible_php ) { |
| 239 | - esc_html_e( 'This plugin doesn’t work with your version of PHP.', 'chatbot' ); | |
| 262 | + _e( 'This plugin doesn’t work with your version of PHP.' ); | |
| 240 | 263 | if ( current_user_can( 'update_php' ) ) { |
| 241 | 264 | printf( |
| 242 | 265 | /* translators: %s: URL to Update PHP page. */ |
| 243 | - '<a href="%s">Learn more about updating PHP</a>.', | |
| 266 | + ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), | |
| 244 | 267 | esc_url( wp_get_update_php_url() ) |
| 245 | 268 | ); |
| 246 | 269 | wp_update_php_annotation( '</p><p><em>', '</em>' ); |
| 247 | 270 | } |
| @@ -260,9 +283,8 @@ | ||
| 260 | 283 | </div> |
| 261 | 284 | <div class="action-links"> |
| 262 | 285 | <?php |
| 263 | 286 | if ( $action_links ) { |
| 264 | - // phpcs:ignore | |
| 265 | 287 | echo '<ul class="plugin-action-buttons"><li>' . implode( '</li><li>', $action_links ) . '</li></ul>'; |
| 266 | 288 | } |
| 267 | 289 | ?> |
| 268 | 290 | </div> |