Plugin Directory

Changeset 3244924


Ignore:
Timestamp:
02/22/2025 03:23:59 PM (12 months ago)
Author:
MrViSiOn
Message:

1.0.47

  • Info site endpoint.
Location:
multi-connect
Files:
21 added
4 edited

Legend:

Unmodified
Added
Removed
  • multi-connect/trunk/includes/class-admin.php

    r3243412 r3244924  
    5050    public function display_connection_notice() {
    5151        if ( ! get_option( 'multiconnect_show_notice' ) ) {
    52 //            return;
     52            return;
    5353        }
    5454
  • multi-connect/trunk/includes/class-multi-connect-api.php

    r3244671 r3244924  
    168168                'callback'            => [ $this, 'process_auto_login' ],
    169169                'permission_callback' => '__return_true',
     170            )
     171        );
     172
     173        register_rest_route(
     174            $this->namespace,
     175            '/site-info',
     176            array(
     177                'methods'             => 'GET',
     178                'callback'            => [ $this, 'get_site_info' ],
     179                'permission_callback' => array( $this, 'check_update_permission' ),
    170180            )
    171181        );
     
    11271137        exit;
    11281138    }
     1139
     1140    public function get_site_info($request) {
     1141        $systemInfo = [];
     1142
     1143        $siteChecker = WP_Site_Health::get_instance();
     1144        $systemChecks = WP_Site_Health::get_tests();
     1145        $systemChecks = $systemChecks['direct'];
     1146
     1147        $requiredChecks = [
     1148            'wordpress_version',
     1149            'php_version',
     1150            'php_extensions',
     1151            'php_default_timezone',
     1152            'sql_server',
     1153            'ssl_support',
     1154            'file_uploads',
     1155            'available_updates_disk_space',
     1156            'autoloaded_options',
     1157        ];
     1158
     1159        foreach ( $requiredChecks as $checkName ) {
     1160            if (!isset($systemChecks[ $checkName ])) {
     1161                continue;
     1162            }
     1163            $checkLabel = $systemChecks[ $checkName ]['test'];
     1164            $checkFunction = 'get_test_' . $checkLabel;
     1165
     1166            if ( ! method_exists( $siteChecker, $checkFunction ) ) {
     1167                continue;
     1168            }
     1169
     1170            $systemInfo[ $checkLabel ] = $siteChecker->{$checkFunction}();
     1171        }
     1172
     1173        return $systemInfo;
     1174    }
    11291175}
  • multi-connect/trunk/multi-connect.php

    r3244671 r3244924  
    44 * Plugin URI: https://multi-wp.com
    55 * Description: Connect your WordPress site with Multi-WP for centralized management and updates.
    6  * Version: 1.0.46
     6 * Version: 1.0.47
    77 * Requires at least: 5.8
    88 * Requires PHP: 7.4
  • multi-connect/trunk/readme.txt

    r3244671 r3244924  
    55Tested up to: 6.7
    66Requires PHP: 7.4
    7 Stable tag: 1.0.46
     7Stable tag: 1.0.47
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    4444
    4545== Changelog ==
     46
     47= 1.0.47 =
     48* Info site.
    4649
    4750= 1.0.46 =
Note: See TracChangeset for help on using the changeset viewer.