Skip to content

Commit

Permalink
Merge pull request #328 from reepay/rs-dev
Browse files Browse the repository at this point in the history
Add link install the WP Rollback plugin and update to version 1.7.4
  • Loading branch information
markusbrunke authored Jun 26, 2024
2 parents b02b4db + e82ef92 commit bfaf5e8
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 4 deletions.
7 changes: 4 additions & 3 deletions Readme.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
=== Official Billwerk+ Payments Gateway ===
Contributors: reepaydenmark,aaitse
Tags: payment, billwerk+, reepay, subscription, visa, mastercard, dankort, mobilepay, woocommerce
Tags: billwerk+, visa, mastercard, dankort, mobilepay
Requires at least: 4.0
Tested up to: 6.5.3
Requires PHP: 7.4
Stable tag: 1.7.4
License: GPL
License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html

Accept Visa, MasterCard, Dankort, MobilePay, American Express, Diners Club and more directly on your store with the Billwerk+ Payment Gateway for WooCommerce.
The Billwerk+ Payments plugin extends WooCommerce allowing you to take payments on your store via Billwerk+ Payments\'s API.
Accept Visa, MasterCard, Dankort, MobilePay, American Express, Diners Club and more directly on your store with the Billwerk+ Payment Gateway.

== Description ==
Accept Visa, MasterCard, Dankort, MobilePay, American Express, Diners Club and more directly on your store with the Billwerk+ Payment Gateway for WooCommerce.
Expand All @@ -18,6 +18,7 @@ The Billwerk+ Payments plugin extends WooCommerce allowing you to take payments
See installation guide right here: https://docu.billwerk.plus/help/en/apps/woocommerce/setup-woocommerce-plugin.html

== Changelog ==
v 1.7.4 - Add link install the WP Rollback plugin
v 1.7.3 - Logo fixes, WP last support, Order text clear
v 1.7.2 - Fixes, refactor, tests
v 1.7.1 - New methods add, WPML detect language support, change order calculation
Expand Down
50 changes: 50 additions & 0 deletions includes/Admin/PluginsPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class PluginsPage {
public function __construct() {
add_filter( 'plugin_action_links_' . reepay()->get_setting( 'plugin_basename' ), array( $this, 'add_action_links' ) );
add_filter( 'plugin_row_meta', array( $this, 'add_plugin_row_meta' ), 10, 2 );
add_filter( 'plugin_row_meta', array( $this, 'rollback_link' ), 20, 2 );
}

/**
Expand Down Expand Up @@ -59,4 +60,53 @@ public function add_plugin_row_meta( $links, $file ): array {

return $links;
}

/**
* Show Rollback plugin install, activate URL
*
* @param mixed $links Plugin Row Meta.
* @param mixed $file Plugin Base file.
*
* @return links
*/
public function rollback_link( $links, $file ): array {
if ( reepay()->get_setting( 'plugin_basename' ) === $file ) {
$rollback_link = null;
$plugin_file_path = WP_PLUGIN_DIR . '/wp-rollback/wp-rollback.php';
if ( ! file_exists( $plugin_file_path ) ) {
/**
* Generate install WP-Rollback plguin URL
*/
$action = 'install-plugin';
$slug = 'wp-rollback';
$url = wp_nonce_url(
add_query_arg(
array(
'action' => $action,
'plugin' => $slug,
),
admin_url( 'update.php' )
),
$action . '_' . $slug
);
$rollback_link = "<a href='$url'>" . esc_html__( 'Rollback using WP Rollback', 'reepay-checkout-gateway' ) . '</a>';
} elseif ( ! in_array( 'wp-rollback/wp-rollback.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ), true ) ) {
/**
* Generate activate WP-Rollback plguin URL
*/
$path = 'wp-rollback/wp-rollback.php';
$url = wp_nonce_url( admin_url( 'plugins.php?action=activate&plugin=' . $path ), 'activate-plugin_' . $path );
$rollback_link = "<a href='$url'>" . esc_html__( 'Activate Rollback', 'reepay-checkout-gateway' ) . '</a>';
}

if ( $rollback_link ) {
array_push(
$links,
$rollback_link
);
}
}

return $links;
}
}
2 changes: 1 addition & 1 deletion reepay-woocommerce-payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Description: Get a plug-n-play payment solution for WooCommerce, that is easy to use, highly secure and is built to maximize the potential of your e-commerce.
* Author: Billwerk+
* Author URI: http://billwerk.plus
* Version: 1.7.3
* Version: 1.7.4
* Text Domain: reepay-checkout-gateway
* Domain Path: /languages
* WC requires at least: 3.0.0
Expand Down

0 comments on commit bfaf5e8

Please sign in to comment.