Skip to content

Commit 0f2319a

Browse files
committed
Without the unit tests in #56
1 parent 7a9631c commit 0f2319a

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

.github/workflows/phpunit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020

2121
name: PHP ${{ matrix.php }} tests in WP ${{ matrix.wordpress }}
2222
steps:
23-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v3.5.3
2424

2525
# get the PHP version
26-
- uses: shivammathur/setup-php@v2
26+
- uses: shivammathur/setup-php@2.25.5
2727
with:
2828
php-version: ${{ matrix.php }}
2929
- name: Installing WordPress

admin/class-uninstall-admin-page.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ public function dispatch() {
4646
$dirname = $this->settings->get_runtime_option( 'awpcp-uploads-dir' );
4747

4848
if ( 0 === strcmp( $action, 'uninstall' ) ) {
49+
// Check the wp_nonce_url.
50+
$nonce = awpcp_get_var( array( 'param' => '_wpnonce' ), 'get' );
51+
if ( ! wp_verify_nonce( $nonce, 'awpcp-uninstall' ) || ! awpcp_current_user_is_admin() ) {
52+
wp_die( esc_html__( 'You are not authorized to perform this action.', 'another-wordpress-classifieds-plugin' ) );
53+
}
54+
4955
$this->uninstaller->uninstall();
5056
}
5157

admin/templates/admin-panel-uninstall.tpl.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,19 @@
2424
</ol>
2525

2626
<p>
27-
<?php $href = add_query_arg( array( 'action' => 'uninstall' ), $url ); ?>
28-
<a class="button button-primary" href="<?php echo esc_url( $href ); ?>"><?php esc_html_e( 'Proceed with Uninstalling AWP Classifieds Plugin', 'another-wordpress-classifieds-plugin' ); ?></a>
27+
<a class="button button-primary" href="<?php echo wp_nonce_url( add_query_arg( array( 'action' => 'uninstall' ), $url ), 'awpcp-uninstall' ); ?>">
28+
<?php esc_html_e( 'Proceed with Uninstalling AWP Classifieds Plugin', 'another-wordpress-classifieds-plugin' ); ?>
29+
</a>
2930
</p>
3031

3132
<?php elseif ( 'uninstall' === $action ) : ?>
3233

3334
<h3><?php esc_html_e( 'Almost done... one more step!', 'another-wordpress-classifieds-plugin' ); ?></h3>
3435

3536
<p>
36-
<a class="button button-primary" href="<?php echo esc_attr( admin_url( 'plugins.php?deactivate=true' ) ); ?>"><?php esc_html_e( 'Please click here to complete the uninstallation process', 'another-wordpress-classifieds-plugin' ); ?></a>
37+
<a class="button button-primary" href="<?php echo esc_attr( admin_url( 'plugins.php' ) ); ?>">
38+
<?php esc_html_e( 'Please click here to deactivate plugins.', 'another-wordpress-classifieds-plugin' ); ?>
39+
</a>
3740
</p>
3841

3942
<?php endif ?>

0 commit comments

Comments
 (0)