PluginProbe
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services / 4.3.7
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services v4.3.7
8.7.8 8.7.7 8.7.6 8.7.5 8.7.4 8.7.3 8.7.2 8.7.1 8.7.0 8.6.9 8.6.8 8.6.7 8.6.6 8.6.5 8.6.4 8.6.2 8.6.1 8.6.0 8.5.9 8.5.8 8.5.7 8.5.6 8.5.5 8.5.4 8.5.3 All 534 releases
chatbot / qcld-recommendbot-plugin.php

qcld-recommendbot-plugin.php in WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services 4.3.7, at qcld-recommendbot-plugin.php

300 lines 15.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if (defined('ABSPATH') === false) {
3 exit;
4 }
5
6 ?>
7 <?php
8 require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
9 remove_all_filters('plugins_api');
10 $qcld_chatplugintags = array(
11 'a' => array(
12 'href' => array(),
13 'title' => array(),
14 'target' => array(),
15 ),
16 );
17
18 $qcld_plugininstal = array();
19
20 /* Conversational Forms Plugins */
21 $argus = [
22 'slug' => 'conversational-forms',
23 'fields' => [
24 'short_description' => true,
25 'icons' => true,
26 'reviews' => false, // excludes all reviews
27 ],
28 ];
29
30 $data = plugins_api( 'plugin_information', $argus );
31 if ( $data && ! is_wp_error( $data ) ) {
32 $qcld_plugininstal['convers-form'] = $data;
33 $qcld_plugininstal['convers-form']->name = 'Conversational Forms for ChatBot';
34 }
35 ?>
36
37 <div class="wrap recommended-plugins">
38 <div class="wp-list-table widefat plugin-install">
39 <div class="the-list">
40 <?php
41 foreach ( (array) $qcld_plugininstal as $plugin ) {
42 if ( is_object( $plugin ) ) {
43 $plugin = (array) $plugin;
44 }
45
46 // Display the group heading if there is one.
47 if ( isset( $plugin['group'] ) && $plugin['group'] != $group ) {
48 if ( isset( $this->groups[ $plugin['group'] ] ) ) {
49 $group_name = $this->groups[ $plugin['group'] ];
50 if ( isset( $plugins_group_titles[ $group_name ] ) ) {
51 $group_name = $plugins_group_titles[ $group_name ];
52 }
53 } else {
54 $group_name = $plugin['group'];
55 }
56
57 // Starting a new group, close off the divs of the last one.
58 if ( ! empty( $group ) ) {
59 echo '</div></div>';
60 }
61
62 echo '<div class="plugin-group"><h3>' . esc_html( $group_name ) . '</h3>';
63 // Needs an extra wrapping div for nth-child selectors to work.
64 echo '<div class="plugin-items">';
65
66 $group = $plugin['group'];
67 }
68 $title = wp_kses( $plugin['name'], $qcld_chatplugintags );
69
70 // Remove any HTML from the description.
71 $description = strip_tags( $plugin['short_description'] );
72 $version = wp_kses( $plugin['version'], $qcld_chatplugintags );
73
74 $name = strip_tags( $title . ' ' . $version );
75
76 $author = wp_kses( $plugin['author'], $qcld_chatplugintags );
77 if ( ! empty( $author ) ) {
78 /* translators: %s: Plugin author. */
79 $author = ' <cite>' . sprintf( __( 'By %s' ), $author ) . '</cite>';
80 }
81
82 $requires_php = isset( $plugin['requires_php'] ) ? $plugin['requires_php'] : null;
83 $requires_wp = isset( $plugin['requires'] ) ? $plugin['requires'] : null;
84
85 $compatible_php = is_php_version_compatible( $requires_php );
86 $compatible_wp = is_wp_version_compatible( $requires_wp );
87 $tested_wp = ( empty( $plugin['tested'] ) || version_compare( get_bloginfo( 'version' ), $plugin['tested'], '<=' ) );
88
89 $action_links = array();
90
91 if ( current_user_can( 'install_plugins' ) || current_user_can( 'update_plugins' ) ) {
92 $status = install_plugin_install_status( $plugin );
93
94 switch ( $status['status'] ) {
95 case 'install':
96 if ( $status['url'] ) {
97 if ( $compatible_php && $compatible_wp ) {
98 $action_links[] = sprintf(
99 '<a class="install-now button" data-slug="%s" href="%s" aria-label="%s" data-name="%s">%s</a>',
100 esc_attr( $plugin['slug'] ),
101 esc_url( $status['url'] ),
102 /* translators: %s: Plugin name and version. */
103 esc_attr( sprintf( _x( 'Install %s now', 'plugin' ), $name ) ),
104 esc_attr( $name ),
105 __( 'Install Now' )
106 );
107 } else {
108 $action_links[] = sprintf(
109 '<button type="button" class="button button-disabled" disabled="disabled">%s</button>',
110 _x( 'Cannot Install', 'plugin' )
111 );
112 }
113 }
114 break;
115
116 case 'update_available':
117 if ( $status['url'] ) {
118 if ( $compatible_php && $compatible_wp ) {
119 $action_links[] = sprintf(
120 '<a class="update-now button aria-button-if-js" data-plugin="%s" data-slug="%s" href="%s" aria-label="%s" data-name="%s">%s</a>',
121 esc_attr( $status['file'] ),
122 esc_attr( $plugin['slug'] ),
123 esc_url( $status['url'] ),
124 /* translators: %s: Plugin name and version. */
125 esc_attr( sprintf( _x( 'Update %s now', 'plugin' ), $name ) ),
126 esc_attr( $name ),
127 __( 'Update Now' )
128 );
129 } else {
130 $action_links[] = sprintf(
131 '<button type="button" class="button button-disabled" disabled="disabled">%s</button>',
132 _x( 'Cannot Update', 'plugin' )
133 );
134 }
135 }
136 break;
137
138 case 'latest_installed':
139 case 'newer_installed':
140 if ( is_plugin_active( $status['file'] ) ) {
141 $action_links[] = sprintf(
142 '<button type="button" class="button button-disabled" disabled="disabled">%s</button>',
143 _x( 'Active', 'plugin' )
144 );
145 } elseif ( current_user_can( 'activate_plugin', $status['file'] ) ) {
146 $button_text = __( 'Activate' );
147 /* translators: %s: Plugin name. */
148 $button_label = _x( 'Activate %s', 'plugin' );
149 $activate_url = add_query_arg(
150 array(
151 '_wpnonce' => wp_create_nonce( 'activate-plugin_' . $status['file'] ),
152 'action' => 'activate',
153 'plugin' => $status['file'],
154 ),
155 network_admin_url( 'plugins.php' )
156 );
157
158 if ( is_network_admin() ) {
159 $button_text = __( 'Network Activate' );
160 /* translators: %s: Plugin name. */
161 $button_label = _x( 'Network Activate %s', 'plugin' );
162 $activate_url = add_query_arg( array( 'networkwide' => 1 ), $activate_url );
163 }
164
165 $action_links[] = sprintf(
166 '<a href="%1$s" class="button activate-now" aria-label="%2$s">%3$s</a>',
167 esc_url( $activate_url ),
168 esc_attr( sprintf( $button_label, $plugin['name'] ) ),
169 $button_text
170 );
171 } else {
172 $action_links[] = sprintf(
173 '<button type="button" class="button button-disabled" disabled="disabled">%s</button>',
174 _x( 'Installed', 'plugin' )
175 );
176 }
177 break;
178 }
179 }
180
181 $details_link = self_admin_url(
182 'plugin-install.php?tab=plugin-information&amp;plugin=' . $plugin['slug'] .
183 '&amp;width=700&amp;height=550'
184 );
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">&times;</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
205 /*===show icon ==*/
206
207 if ( ! empty( $plugin['icons']['svg'] ) ) {
208 $plugin_icon_url = $plugin['icons']['svg'];
209 } elseif ( ! empty( $plugin['icons']['2x'] ) ) {
210 $plugin_icon_url = $plugin['icons']['2x'];
211 } elseif ( ! empty( $plugin['icons']['1x'] ) ) {
212 $plugin_icon_url = $plugin['icons']['1x'];
213 } else {
214 $plugin_icon_url = $plugin['icons']['default'];
215 }
216
217 /*
218 * $action_links An array of plugin action links. Defaults are links to Details and Install Now.
219 * $plugin The plugin currently being listed.
220 */
221 $action_links = apply_filters( 'plugin_install_action_links', $action_links, $plugin );
222
223 $last_updated_timestamp = strtotime( $plugin['last_updated'] );
224 ?>
225 <div class="plugin-card plugin-card-<?php echo sanitize_html_class( $plugin['slug'] ); ?>">
226 <?php
227 if ( ! $compatible_php || ! $compatible_wp ) {
228 echo '<div class="notice inline notice-error notice-alt"><p>';
229 if ( ! $compatible_php && ! $compatible_wp ) {
230 _e( 'This plugin doesn&#8217;t work with your versions of WordPress and PHP.' );
231 if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
232 printf(
233 /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
234 ' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
235 self_admin_url( 'update-core.php' ),
236 esc_url( wp_get_update_php_url() )
237 );
238 wp_update_php_annotation( '</p><p><em>', '</em>' );
239 } elseif ( current_user_can( 'update_core' ) ) {
240 printf(
241 /* translators: %s: URL to WordPress Updates screen. */
242 ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
243 self_admin_url( 'update-core.php' )
244 );
245 } elseif ( current_user_can( 'update_php' ) ) {
246 printf(
247 /* translators: %s: URL to Update PHP page. */
248 ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
249 esc_url( wp_get_update_php_url() )
250 );
251 wp_update_php_annotation( '</p><p><em>', '</em>' );
252 }
253 } elseif ( ! $compatible_wp ) {
254 _e( 'This plugin doesn&#8217;t work with your version of WordPress.' );
255 if ( current_user_can( 'update_core' ) ) {
256 printf(
257 /* translators: %s: URL to WordPress Updates screen. */
258 ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
259 self_admin_url( 'update-core.php' )
260 );
261 }
262 } elseif ( ! $compatible_php ) {
263 _e( 'This plugin doesn&#8217;t work with your version of PHP.' );
264 if ( current_user_can( 'update_php' ) ) {
265 printf(
266 /* translators: %s: URL to Update PHP page. */
267 ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
268 esc_url( wp_get_update_php_url() )
269 );
270 wp_update_php_annotation( '</p><p><em>', '</em>' );
271 }
272 }
273 echo '</p></div>';
274 }
275 ?>
276 <div class="plugin-card-top">
277 <div class="name column-name">
278 <h3>
279 <a href="<?php echo esc_url( $details_link ); ?>" class="thickbox open-plugin-details-modal">
280 <?php echo esc_attr($title); ?>
281 <img src="<?php echo esc_attr( $plugin_icon_url ); ?>" class="plugin-icon" alt="" />
282 </a>
283 </h3>
284 </div>
285 <div class="action-links">
286 <?php
287 if ( $action_links ) {
288 echo '<ul class="plugin-action-buttons"><li>' . implode( '</li><li>', $action_links ) . '</li></ul>';
289 }
290 ?>
291 </div>
292
293 </div>
294 </div>
295 <?php
296 } ?>
297 </div>
298 </div>
299
300 </div>