芝麻web文件管理V1.00
编辑当前文件:/home/royashxg/www/wp-content/plugins/premium-addons-for-elementor/admin/includes/feedback.php
false ); $data = $_POST['data']; if ( isset( $data['feedback'] ) ) { $reason = $data['feedback']; $suggestions = isset( $data['suggestions'] ) ? $data['suggestions'] : null; $anonymous = isset( $data['anonymous'] ) ? ! ! $data['anonymous'] : false; } if ( ! is_string( $reason ) || empty( $reason ) ) { return false; } $wordpress = self::collect_wordpress_data( true ); $wordpress['deactivated_plugin']['uninstall_reason'] = $reason; $wordpress['deactivated_plugin']['uninstall_details'] = ''; if ( ! empty( $suggestions ) ) { $wordpress['deactivated_plugin']['uninstall_details'] .= $suggestions; } if ( ! $anonymous ) { $wordpress['deactivated_plugin']['uninstall_details'] .= ( empty( $wordpress['deactivated_plugin']['uninstall_details'] ) ? '' : PHP_EOL . PHP_EOL ) . 'Domain: ' . self::get_site_domain(); } $body = array( 'user' => self::collect_user_data( $anonymous ), 'wordpress' => $wordpress, ); $api_url = 'https://feedbackpa.leap13.com/wp-json/feedback/v2/add'; $response = wp_safe_remote_request( $api_url, array( 'headers' => array( 'Content-Type' => 'application/json', ), 'body' => wp_json_encode( $body ), 'timeout' => 20, 'method' => 'POST', 'httpversion' => '1.1', ) ); if ( is_wp_error( $response ) ) { wp_send_json_error( 'REQUEST ERR' ); } if ( ! isset( $response['response'] ) || ! is_array( $response['response'] ) ) { wp_send_json_error( 'REQUEST UNKNOWN' ); } if ( ! isset( $response['body'] ) ) { wp_send_json_error( 'REQUEST PAYLOAD EMPTY' ); } wp_send_json_success( ( $response['body'] ) ); } /** * Method generates Feedback popup */ public function create_popup() { $plugin_data = get_plugin_data( PREMIUM_ADDONS_FILE ); ?>
</textarea>
%s', $link, __(' how to increase the PHP limits', 'premium-addons-for-elementor') ); ?>
array( 'version' => $current_plugin['Version'], 'memory' => 'Memory: ' . size_format( wp_convert_hr_to_bytes( ini_get( 'memory_limit' ) ) ), 'time' => 'Time: ' . ini_get( 'max_execution_time' ), 'install' => 'Activation: ' . get_option( 'pa_install_time' ), 'deactivate' => 'Deactivation: ' . gmdate( 'j F, Y', time() ) ), ); if ( $detailed ) { $data['extra'] = array( 'locale' => ( get_bloginfo( 'version' ) >= 4.7 ) ? get_user_locale() : get_locale(), 'themes' => self::get_themes(), 'plugins' => self::get_plugins(), ); } return $data; } /** * Get a list of installed plugins */ private static function get_plugins() { if ( ! function_exists( 'get_plugins' ) ) { include ABSPATH . '/wp-admin/includes/plugin.php'; } // $plugins = get_plugins(); $option = get_option( 'active_plugins', array() ); $active = array(); // $installed = array(); // foreach ( $plugins as $id => $info ) { // if ( in_array( $id, $active ) ) { // continue; // } // $id = explode( '/', $id ); // $id = ucwords( str_replace( '-', ' ', $id[0] ) ); // $installed[] = $id; // } foreach ( $option as $id ) { $id = explode( '/', $id ); $id = ucwords( str_replace( '-', ' ', $id[0] ) ); $active[] = $id; } return array( // 'installed' => $installed, 'active' => $active, ); } /** * Get current themes * * @return array */ private static function get_themes() { $theme = wp_get_theme(); return array( // 'installed' => self::get_installed_themes(), 'active' => array( 'name' => $theme->get( 'Name' ), ), ); } /** * Get an array of installed themes * * @return array */ private static function get_installed_themes() { $installed = wp_get_themes(); $theme = get_stylesheet(); $data = array(); foreach ( $installed as $slug => $info ) { if ( $slug === $theme ) { continue; } $data[ $slug ] = array( 'name' => $info->get( 'Name' ), ); } return $data; } /** * Collect user data. * * @param bool $anonymous * * @return array */ private static function collect_user_data( $anonymous ) { $user = wp_get_current_user(); $return = array( 'email' => '', 'first_name' => '', 'last_name' => '', 'domain' => '', ); if ( $user && ! $anonymous ) { $return['email'] = $user->user_email; $return['first_name'] = $user->first_name; $return['last_name'] = $user->last_name; $return['domain'] = self::get_site_domain(); } return $return; } private static function get_site_domain() { return function_exists( 'parse_url' ) ? parse_url( get_home_url(), PHP_URL_HOST ) : false; } /** * Creates and returns an instance of the class * * @since 3.20.9 * @access public * * @return object */ public static function get_instance() { if ( ! isset( self::$instance ) ) { self::$instance = new self(); } return self::$instance; } }