Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:

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

# get the PHP version
- uses: shivammathur/setup-php@v2
- uses: shivammathur/setup-php@2.25.5
with:
php-version: ${{ matrix.php }}
- name: Installing WordPress
Expand Down
6 changes: 6 additions & 0 deletions admin/class-uninstall-admin-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ public function dispatch() {
$dirname = $this->settings->get_runtime_option( 'awpcp-uploads-dir' );

if ( 0 === strcmp( $action, 'uninstall' ) ) {
// Check the wp_nonce_url.
$nonce = awpcp_get_var( array( 'param' => '_wpnonce' ), 'get' );
if ( ! wp_verify_nonce( $nonce, 'awpcp-uninstall' ) || ! awpcp_current_user_is_admin() ) {
wp_die( esc_html__( 'You are not authorized to perform this action.', 'another-wordpress-classifieds-plugin' ) );
}

$this->uninstaller->uninstall();
}

Expand Down
9 changes: 6 additions & 3 deletions admin/templates/admin-panel-uninstall.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,19 @@
</ol>

<p>
<?php $href = add_query_arg( array( 'action' => 'uninstall' ), $url ); ?>
<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>
<a class="button button-primary" href="<?php echo wp_nonce_url( add_query_arg( array( 'action' => 'uninstall' ), $url ), 'awpcp-uninstall' ); ?>">
<?php esc_html_e( 'Proceed with Uninstalling AWP Classifieds Plugin', 'another-wordpress-classifieds-plugin' ); ?>
</a>
</p>

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

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

<p>
<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>
<a class="button button-primary" href="<?php echo esc_attr( admin_url( 'plugins.php' ) ); ?>">
<?php esc_html_e( 'Please click here to deactivate plugins.', 'another-wordpress-classifieds-plugin' ); ?>
</a>
</p>

<?php endif ?>
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
"require-dev": {
"yoast/phpunit-polyfills": "^1.0",
"antecedent/patchwork": "^2.1.21",
"brain/monkey": "dev-dev",
"dealerdirect/phpcodesniffer-composer-installer": "0.*",
"phake/phake": "^4.0",
"phpcompatibility/php-compatibility": "*",
"squizlabs/php_codesniffer": "^3.7.0",
"wp-coding-standards/wpcs": "*",
"php-stubs/wordpress-stubs": "^6.0",
"phpstan/phpstan": "^1.8",
"dms/phpunit-arraysubset-asserts": "^0.4.0"
"dms/phpunit-arraysubset-asserts": "^0.4.0",
"10up/wp_mock": "^1.0"
},
"config": {
"allow-plugins": {
Expand Down
Loading