Skip to content
Snippets Groups Projects
Commit 8521cd70 authored by dyszczo's avatar dyszczo
Browse files

faster check

parent 63f05b22
No related branches found
No related tags found
1 merge request!14fixed for get_plugins and msg display
Pipeline #8856 passed with stages
in 43 seconds
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
### Fixed ### Fixed
- Better new error messages display - Better new error messages display
- get_plugins function loaded from wp-admin - get_plugins function loaded from wp-admin
- Faster checks
## [3.0.0] - 2019-09-17 ## [3.0.0] - 2019-09-17
### Changed ### Changed
......
...@@ -343,21 +343,19 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) { ...@@ -343,21 +343,19 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) {
$name = $plugin_info[ self::PLUGIN_INFO_KEY_NAME ]; $name = $plugin_info[ self::PLUGIN_INFO_KEY_NAME ];
$nice_name = $plugin_info[ self::PLUGIN_INFO_KEY_NICE_NAME ]; $nice_name = $plugin_info[ self::PLUGIN_INFO_KEY_NICE_NAME ];
if ( ! self::is_wp_plugin_installed( $name ) ) {
$install_url = $this->prepare_plugin_repository_install_url( $plugin_info );
return $this->prepare_notice_message( sprintf( wp_kses( __( 'The &#8220;%s&#8221; plugin requires free %s plugin. <a href="%s">Install %s →</a>',
$this->get_text_domain() ), array( 'a' => array( 'href' => array() ) ) ),
$this->plugin_name, $nice_name, esc_url( $install_url ), $nice_name ) );
}
if ( ! self::is_wp_plugin_active( $name ) ) { if ( ! self::is_wp_plugin_active( $name ) ) {
if ( ! self::is_wp_plugin_installed( $name ) ) {
$install_url = $this->prepare_plugin_repository_install_url( $plugin_info );
return $this->prepare_notice_message( sprintf( wp_kses( __( 'The &#8220;%s&#8221; plugin requires free %s plugin. <a href="%s">Install %s →</a>',
$this->get_text_domain() ), array( 'a' => array( 'href' => array() ) ) ),
$this->plugin_name, $nice_name, esc_url( $install_url ), $nice_name ) );
}
$activate_url = 'plugins.php?action=activate&plugin=' . urlencode( $plugin_info[ self::PLUGIN_INFO_KEY_NAME ] ) . '&plugin_status=all&paged=1&s&_wpnonce=' . urlencode( wp_create_nonce( 'activate-plugin_' . $name ) ); $activate_url = 'plugins.php?action=activate&plugin=' . urlencode( $plugin_info[ self::PLUGIN_INFO_KEY_NAME ] ) . '&plugin_status=all&paged=1&s&_wpnonce=' . urlencode( wp_create_nonce( 'activate-plugin_' . $name ) );
return $this->prepare_notice_message( sprintf( wp_kses( __( 'The &#8220;%s&#8221; plugin requires activating %s plugin. <a href="%s">Activate %s →</a>', return $this->prepare_notice_message( sprintf( wp_kses( __( 'The &#8220;%s&#8221; plugin requires activating %s plugin. <a href="%s">Activate %s →</a>',
$this->get_text_domain() ), array( 'a' => array( 'href' => array() ) ) ), $this->get_text_domain() ), array( 'a' => array( 'href' => array() ) ) ),
$this->plugin_name, $nice_name, esc_url( admin_url( $activate_url ) ), $nice_name ) ); $this->plugin_name, $nice_name, esc_url( admin_url( $activate_url ) ), $nice_name ) );
} }
return null; return null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment