PluginProbe
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services / 8.7.1
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services v8.7.1
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 8.5.2 All 533 releases
chatbot / qcld-recommendbot-ai-plugin.php

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

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