예제 #1
0
            break;
        case 'get_filesystem_method':
            $actions[$action] = get_filesystem_method();
            break;
        case 'get_wp_version':
            global $wp_version;
            $actions[$action] = (string) $wp_version;
            break;
        case 'get_plugins':
            $actions[$action] = _wprp_supports_plugin_upgrade() ? _wprp_get_plugins() : 'not-implemented';
            break;
        case 'upgrade_plugin':
            $actions[$action] = _wprp_upgrade_plugin((string) $_GET['plugin']);
            break;
        case 'get_themes':
            $actions[$action] = _wprp_supports_theme_upgrade() ? _wprp_get_themes() : 'not-implemented';
            break;
        case 'upgrade_theme':
            $actions[$action] = _wprp_upgrade_theme((string) $_GET['theme']);
            break;
        case 'do_backup':
        case 'delete_backup':
        case 'supports_backups':
        case 'get_backup':
            $actions[$action] = _wprp_backups_api_call($action);
            break;
        default:
            $actions[$action] = 'not-implemented';
            break;
    }
}
예제 #2
0
     break;
 case 'install_plugin':
     $api_args = array('version' => sanitize_text_field(WPR_API_Request::get_arg('version')));
     $actions[$action] = _wprp_install_plugin(sanitize_text_field(WPR_API_Request::get_arg('plugin')), $api_args);
     break;
 case 'activate_plugin':
     $actions[$action] = _wprp_activate_plugin(sanitize_text_field(WPR_API_Request::get_arg('plugin')));
     break;
 case 'deactivate_plugin':
     $actions[$action] = _wprp_deactivate_plugin(sanitize_text_field(WPR_API_Request::get_arg('plugin')));
     break;
 case 'uninstall_plugin':
     $actions[$action] = _wprp_uninstall_plugin(sanitize_text_field(WPR_API_Request::get_arg('plugin')));
     break;
 case 'get_themes':
     $actions[$action] = _wprp_get_themes();
     break;
 case 'install_theme':
     $api_args = array('version' => sanitize_text_field(WPR_API_Request::get_arg('version')));
     $actions[$action] = _wprp_install_theme(sanitize_text_field(WPR_API_Request::get_arg('theme')), $api_args);
     break;
 case 'activate_theme':
     $actions[$action] = _wprp_activate_theme(sanitize_text_field(WPR_API_Request::get_arg('theme')));
     break;
 case 'update_theme':
 case 'upgrade_theme':
     // 'upgrade' is deprecated
     $actions[$action] = _wprp_update_theme(sanitize_text_field(WPR_API_Request::get_arg('theme')));
     break;
 case 'delete_theme':
     $actions[$action] = _wprp_delete_theme(sanitize_text_field(WPR_API_Request::get_arg('theme')));