diff -r 3d4e9c994f10 -r a86126ab1dd4 wp/wp-content/plugins/portfolio/bws_menu/bws_menu.php --- a/wp/wp-content/plugins/portfolio/bws_menu/bws_menu.php Tue Oct 22 16:11:46 2019 +0200 +++ b/wp/wp-content/plugins/portfolio/bws_menu/bws_menu.php Tue Dec 15 13:49:49 2020 +0100 @@ -1,7 +1,7 @@ ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 3 ), 'body' => array( 'plugins' => serialize( $to_send ) ), 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) ); - $raw_response = wp_remote_post( 'http://bestwebsoft.com/wp-content/plugins/paid-products/plugins/update-check/1.0/', $options ); + $raw_response = wp_remote_post( 'https://bestwebsoft.com/wp-content/plugins/paid-products/plugins/pro-license-check/1.0/', $options ); if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) ) { $error = __( "Something went wrong. Please try again later. If the error appears again, please contact us", 'bestwebsoft' ) . ' BestWebSoft. ' . __( "We are sorry for inconvenience.", 'bestwebsoft' ); } else { $response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) ); + if ( is_array( $response ) && !empty( $response ) ) { foreach ( $response as $key => $value ) { if ( "wrong_license_key" == $value->package ) { @@ -179,7 +180,7 @@ $max_execution_time = ( ini_get( 'max_execution_time' ) ) ? ini_get( 'max_execution_time' ) : __( 'N/A', 'bestwebsoft' ); $memory_limit = ( ini_get( 'memory_limit' ) ) ? ini_get( 'memory_limit' ) : __( 'N/A', 'bestwebsoft' ); $wp_memory_limit = ( defined( 'WP_MEMORY_LIMIT' ) ) ? WP_MEMORY_LIMIT : __( 'N/A', 'bestwebsoft' ); - $memory_usage = ( function_exists( 'memory_get_usage' ) ) ? round( memory_get_usage() / 1024 / 1024, 2 ) . __( ' Mb', 'bestwebsoft' ) : __( 'N/A', 'bestwebsoft' ); + $memory_usage = ( function_exists( 'memory_get_usage' ) ) ? round( memory_get_usage() / 1024 / 1024, 2 ) . ' ' . __( 'Mb', 'bestwebsoft' ) : __( 'N/A', 'bestwebsoft' ); $exif_read_data = ( is_callable( 'exif_read_data' ) ) ? __( 'Yes', 'bestwebsoft' ) . " ( V" . substr( phpversion( 'exif' ), 0,4 ) . ")" : __( 'No', 'bestwebsoft' ); $iptcparse = ( is_callable( 'iptcparse' ) ) ? __( 'Yes', 'bestwebsoft' ) : __( 'No', 'bestwebsoft' ); $xml_parser_create = ( is_callable( 'xml_parser_create' ) ) ? __( 'Yes', 'bestwebsoft' ) : __( 'No', 'bestwebsoft' ); @@ -372,77 +373,45 @@ $bws_license_plugin = sanitize_text_field( $_POST['bws_install_plugin'] ); - echo '
' . __( "Downloading install package from", 'bestwebsoft' ) . ' ' . $url . '
'; - - $uploadDir = wp_upload_dir(); - $zip_name = explode( '/', $bws_license_plugin ); - - if ( !function_exists( 'curl_init' ) ) { - $received_content = file_get_contents( $url ); - } else { - $ch = curl_init(); - curl_setopt( $ch, CURLOPT_URL, $url ); - curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); - curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true ); - $received_content = curl_exec( $ch ); - curl_close( $ch ); - } - - if ( ! $received_content ) { - $error = __( "Failed to download the zip archive. Please, upload the plugin manually", 'bestwebsoft' ); - } else { - if ( is_writable( $uploadDir["path"] ) ) { - $file_put_contents = $uploadDir["path"] . "/" . $zip_name[0] . ".zip"; - - if ( file_put_contents( $file_put_contents, $received_content ) ) { - @chmod( $file_put_contents, octdec( 755 ) ); - - echo '' . __( 'Unpacking the package', 'bestwebsoft' ) . '...
'; + if ( is_multisite() ) + update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options ); + else + update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options ); - if ( class_exists( 'ZipArchive' ) ) { - $zip = new ZipArchive(); - if ( $zip->open( $file_put_contents ) === TRUE ) { - echo '' . __( 'Installing the plugin', 'bestwebsoft' ) . '...
'; - $zip->extractTo( WP_PLUGIN_DIR ); - $zip->close(); - } else { - $error = __( "Failed to open the zip archive. Please, upload the plugin manually", 'bestwebsoft' ); - } - } elseif ( class_exists( 'Phar' ) ) { - $phar = new PharData( $file_put_contents ); - echo '' . __( 'Installing the plugin', 'bestwebsoft' ) . '...
'; - $phar->extractTo( WP_PLUGIN_DIR ); - } else { - $error = __( "Your server does not support either ZipArchive or Phar. Please, upload the plugin manually", 'bestwebsoft' ); - } - if ( empty( $error ) ) - echo '' . sprintf( __( 'The plugin %s is successfully installed.', 'bestwebsoft' ), '' . $plugins_array[ $bws_license_plugin ]['name'] . '' ) . '
'; - - @unlink( $file_put_contents ); - } else { - $error = __( "Failed to download the zip archive. Please, upload the plugin manually", 'bestwebsoft' ); - } - } else { - $error = __( "UploadDir is not writable. Please, upload the plugin manually", 'bestwebsoft' ); - } - } - - if ( file_exists( WP_PLUGIN_DIR . '/' . $zip_name[0] ) ) { - echo '' . __( 'Activate Plugin', 'bestwebsoft' ) . ' | ' . __( 'Return to BestWebSoft Panel', 'bestwebsoft' ) . '
'; - } else { - if ( empty( $error ) ) - $error = __( "Failed to download the zip archive. Please, upload the plugin manually", 'bestwebsoft' ); - - echo '' . $error . '
'; - echo '' . __( 'Return to BestWebSoft Panel', 'bestwebsoft' ) . '
'; - } - } else { + $url = $plugins_array[ $bws_license_plugin ]['link'] . '&download_from=5'; ?> + +
+
+
+
+
+
+
+ ' . __( 'Client Area', 'bestwebsoft' ) . '' ); ?>
+