Skip to content

Commit

Permalink
Merge pull request #38 from mbsouth/master
Browse files Browse the repository at this point in the history
PHP 8.2 compatible version
  • Loading branch information
froger-me committed Oct 24, 2023
2 parents 27a4602 + 7aad1f6 commit 18046dd
Show file tree
Hide file tree
Showing 258 changed files with 9,297 additions and 10,453 deletions.
1 change: 1 addition & 0 deletions wp-plugin-update-server/inc/class-wppus-data-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class WPPUS_Data_Manager {
);

protected static $root_data_dirname = 'wppus';
protected $scheduler;

public function __construct( $init_hooks = false ) {

Expand Down
6 changes: 3 additions & 3 deletions wp-plugin-update-server/inc/class-wppus-license-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,17 +223,17 @@ protected function get_submitted_options() {
'condition' => 'boolean',
),
'wppus_license_private_api_auth_key' => array(
'value' => filter_input( INPUT_POST, 'wppus_license_private_api_auth_key', FILTER_SANITIZE_STRING ),
'value' => filter_input( INPUT_POST, 'wppus_license_private_api_auth_key', FILTER_SANITIZE_FULL_SPECIAL_CHARS ),
'display_name' => __( 'Private API Authentication Key', 'wppus' ),
'failure_display_message' => __( 'Not a valid string', 'wppus' ),
),
'wppus_license_hmac_key' => array(
'value' => filter_input( INPUT_POST, 'wppus_license_hmac_key', FILTER_SANITIZE_STRING ),
'value' => filter_input( INPUT_POST, 'wppus_license_hmac_key', FILTER_SANITIZE_FULL_SPECIAL_CHARS ),
'display_name' => __( 'Signatures HMAC Key', 'wppus' ),
'failure_display_message' => __( 'Not a valid string', 'wppus' ),
),
'wppus_license_crypto_key' => array(
'value' => filter_input( INPUT_POST, 'wppus_license_crypto_key', FILTER_SANITIZE_STRING ),
'value' => filter_input( INPUT_POST, 'wppus_license_crypto_key', FILTER_SANITIZE_FULL_SPECIAL_CHARS ),
'display_name' => __( 'Signatures Encryption Key', 'wppus' ),
'failure_display_message' => __( 'Not a valid string', 'wppus' ),
),
Expand Down
5 changes: 2 additions & 3 deletions wp-plugin-update-server/inc/class-wppus-licenses-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ public function prepare_items() {
$per_page,
$offset,
);
$sql = "SELECT *
FROM {$wpdb->prefix}wppus_licenses";
$sql = "SELECT * FROM {$wpdb->prefix}wppus_licenses";

if ( $search ) {
$sql .= $where;
Expand All @@ -161,7 +160,7 @@ public function prepare_items() {

$sql .= " ORDER BY $order_by $order LIMIT %d OFFSET %d";
$query = $wpdb->prepare( $sql, $args ); // @codingStandardsIgnoreLine
error_log($query);

$items = $wpdb->get_results( $query, ARRAY_A ); // @codingStandardsIgnoreLine

foreach ( $items as $index => $item ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function force_register() {
$type = false;

if ( isset( $_REQUEST['nonce'] ) && wp_verify_nonce( $_REQUEST['nonce'], 'wppus_plugin_options' ) ) {
$type = filter_input( INPUT_POST, 'type', FILTER_SANITIZE_STRING );
$type = filter_input( INPUT_POST, 'type', FILTER_SANITIZE_FULL_SPECIAL_CHARS );

if ( 'schedules' === $type ) {
$result = self::register_schedules();
Expand Down Expand Up @@ -113,7 +113,7 @@ public function force_clean() {
$type = false;

if ( isset( $_REQUEST['nonce'] ) && wp_verify_nonce( $_REQUEST['nonce'], 'wppus_plugin_options' ) ) {
$type = filter_input( INPUT_POST, 'type', FILTER_SANITIZE_STRING );
$type = filter_input( INPUT_POST, 'type', FILTER_SANITIZE_FULL_SPECIAL_CHARS );

if ( 'schedules' === $type ) {
$result = self::clear_schedules();
Expand Down Expand Up @@ -245,17 +245,17 @@ protected function get_submitted_options() {
'condition' => 'boolean',
),
'wppus_remote_repository_branch' => array(
'value' => filter_input( INPUT_POST, 'wppus_remote_repository_branch', FILTER_SANITIZE_STRING ),
'value' => filter_input( INPUT_POST, 'wppus_remote_repository_branch', FILTER_SANITIZE_FULL_SPECIAL_CHARS ),
'display_name' => __( 'Packages branch name', 'wppus' ),
'failure_display_message' => __( 'Not a valid string', 'wppus' ),
),
'wppus_remote_repository_credentials' => array(
'value' => filter_input( INPUT_POST, 'wppus_remote_repository_credentials', FILTER_SANITIZE_STRING ),
'value' => filter_input( INPUT_POST, 'wppus_remote_repository_credentials', FILTER_SANITIZE_FULL_SPECIAL_CHARS ),
'display_name' => __( 'Remote repository service credentials', 'wppus' ),
'failure_display_message' => __( 'Not a valid string', 'wppus' ),
),
'wppus_remote_repository_check_frequency' => array(
'value' => filter_input( INPUT_POST, 'wppus_remote_repository_check_frequency', FILTER_SANITIZE_STRING ),
'value' => filter_input( INPUT_POST, 'wppus_remote_repository_check_frequency', FILTER_SANITIZE_FULL_SPECIAL_CHARS ),
'display_name' => __( 'Remote update check frequency', 'wppus' ),
'failure_display_message' => __( 'Not a valid option', 'wppus' ),
'condition' => 'known frequency',
Expand Down
5 changes: 3 additions & 2 deletions wp-plugin-update-server/inc/class-wppus-update-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class WPPUS_Update_Manager {

protected $packages_table;
protected $scheduler;
protected $rows = array();

public function __construct( $init_hooks = false ) {

Expand Down Expand Up @@ -265,7 +266,7 @@ public function force_clean() {
$type = false;

if ( isset( $_REQUEST['nonce'] ) && wp_verify_nonce( $_REQUEST['nonce'], 'wppus_plugin_options' ) ) {
$type = filter_input( INPUT_POST, 'type', FILTER_SANITIZE_STRING );
$type = filter_input( INPUT_POST, 'type', FILTER_SANITIZE_FULL_SPECIAL_CHARS );

if ( in_array( $type, self::$filesystem_clean_types ) ) { // @codingStandardsIgnoreLine
$result = WPPUS_Data_Manager::maybe_cleanup( $type, true );
Expand Down Expand Up @@ -293,7 +294,7 @@ public function prime_package_from_remote() {
$slug = 'N/A';

if ( isset( $_REQUEST['nonce'] ) && wp_verify_nonce( $_REQUEST['nonce'], 'wppus_plugin_options' ) ) {
$slug = filter_input( INPUT_POST, 'slug', FILTER_SANITIZE_STRING );
$slug = filter_input( INPUT_POST, 'slug', FILTER_SANITIZE_FULL_SPECIAL_CHARS );

if ( $slug ) {
Wppus_Update_Server::unlock_update_from_remote( $slug );
Expand Down
15 changes: 9 additions & 6 deletions wp-plugin-update-server/inc/class-wppus-update-server.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?php
require WPPUS_PLUGIN_PATH . '/lib/plugin-update-checker/plugin-update-checker.php';

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
use YahnisElsts\PluginUpdateChecker\v5p1\Vcs\GitHubApi;
use YahnisElsts\PluginUpdateChecker\v5p1\Vcs\GitLabApi;
use YahnisElsts\PluginUpdateChecker\v5p1\Vcs\BitBucketApi;

defined( 'ABSPATH' ) OR exit; // Exit if accessed directly

class WPPUS_Update_Server extends Wpup_UpdateServer {

Expand Down Expand Up @@ -284,21 +287,21 @@ protected function init_update_checker( $slug ) {
return;
}

require_once WPPUS_PLUGIN_PATH . 'lib/plugin-update-checker/plugin-update-checker.php';
//require_once WPPUS_PLUGIN_PATH . 'lib/plugin-update-checker/plugin-update-checker.php';
require_once WPPUS_PLUGIN_PATH . 'lib/proxy-update-checker/proxy-update-checker.php';

if ( $this->repository_service_self_hosted ) {

if ( 'Plugin' === $this->type ) {
$this->update_checker = new Proxuc_Vcs_PluginUpdateChecker(
new Puc_v4p4_Vcs_GitLabApi( trailingslashit( $this->repository_service_url ) . $slug ),
new GitLabApi( trailingslashit( $this->repository_service_url ) . $slug ),
$slug,
$slug,
$this->packageDirectory // @codingStandardsIgnoreLine
);
} elseif ( 'Theme' === $this->type ) {
$this->update_checker = new Proxuc_Vcs_ThemeUpdateChecker(
new Puc_v4p4_Vcs_GitLabApi( trailingslashit( $this->repository_service_url ) . $slug ),
new GitLabApi( trailingslashit( $this->repository_service_url ) . $slug ),
$slug,
$slug,
$this->packageDirectory // @codingStandardsIgnoreLine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
<p>
<?php echo esc_html( $result ); ?>
</p>
<button type="button" class="notice-dismiss">
<span class="screen-reader-text"><?php esc_html_e( 'Dismiss this notice.' ); ?></span>
</button>
</div>
<?php elseif ( is_array( $result ) && ! empty( $result ) ) : ?>
<div class="error notice notice-error is-dismissible">
Expand All @@ -19,9 +16,6 @@
<li><?php echo esc_html( $message ); ?></li>
<?php endforeach; ?>
</ul>
<button type="button" class="notice-dismiss">
<span class="screen-reader-text"><?php esc_html_e( 'Dismiss this notice.' ); ?></span>
</button>
</div>
<?php endif; ?>
<h2 class="nav-tab-wrapper">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
<p>
<?php echo esc_html( $updated ); ?>
</p>
<button type="button" class="notice-dismiss">
<span class="screen-reader-text"><?php esc_html_e( 'Dismiss this notice.' ); ?></span>
</button>
</div>
<?php elseif ( is_array( $updated ) && ! empty( $updated ) ) : ?>
<div class="error notice notice-error is-dismissible">
Expand All @@ -19,19 +16,13 @@
<li><?php echo esc_html( $message ); ?></li>
<?php endforeach; ?>
</ul>
<button type="button" class="notice-dismiss">
<span class="screen-reader-text"><?php esc_html_e( 'Dismiss this notice.' ); ?></span>
</button>
</div>
<?php endif; ?>
<?php if ( is_string( $action_error ) && ! empty( $action_error ) ) : ?>
<div class="error notice notice-error is-dismissible">
<p>
<?php echo esc_html( $action_error ); ?>
</p>
<button type="button" class="notice-dismiss">
<span class="screen-reader-text"><?php esc_html_e( 'Dismiss this notice.' ); ?></span>
</button>
</div>
<?php endif; ?>
<h2 class="nav-tab-wrapper">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
<p>
<?php echo esc_html( $updated ); ?>
</p>
<button type="button" class="notice-dismiss">
<span class="screen-reader-text"><?php esc_html_e( 'Dismiss this notice.' ); ?></span>
</button>
</div>
<?php elseif ( is_array( $updated ) && ! empty( $updated ) ) : ?>
<div class="error notice notice-error is-dismissible">
Expand All @@ -19,19 +16,13 @@
<li><?php echo esc_html( $message ); ?></li>
<?php endforeach; ?>
</ul>
<button type="button" class="notice-dismiss">
<span class="screen-reader-text"><?php esc_html_e( 'Dismiss this notice.' ); ?></span>
</button>
</div>
<?php endif; ?>
<?php if ( is_string( $action_error ) && ! empty( $action_error ) ) : ?>
<div class="error notice notice-error is-dismissible">
<p>
<?php echo esc_html( $action_error ); ?>
</p>
<button type="button" class="notice-dismiss">
<span class="screen-reader-text"><?php esc_html_e( 'Dismiss this notice.' ); ?></span>
</button>
</div>
<?php endif; ?>
<h2 class="nav-tab-wrapper">
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace YahnisElsts\PluginUpdateChecker\v5;

if ( !class_exists(PucFactory::class, false) ):

class PucFactory extends \YahnisElsts\PluginUpdateChecker\v5p1\PucFactory {
}

endif;
Loading

0 comments on commit 18046dd

Please sign in to comment.