Passed
Push — 252-fix/delete-post-revision-t... ( 2d4c2c...2c79ef )
by Sudar
08:04 queued 03:02
created

UpsellModule::get_success_message()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace BulkWP\BulkDelete\Core\Addon;
4
5
use BulkWP\BulkDelete\Core\Base\BaseModule;
6
7
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
8
9
/**
10
 * A Module that upsells an add-on.
11
 *
12
 * Upseller Module is displayed for add-ons with a description and a link to buy them.
13
 * If an add-on is installed, then the Upseller Module is automatically deactivated.
14
 *
15
 * Methods that are not needed are left empty.
16
 *
17
 * @since 6.0.0
18
 */
19
class UpsellModule extends BaseModule {
20
21
	/**
22
	 * Details about the add-on.
23
	 *
24
	 * @var \BulkWP\BulkDelete\Core\Addon\AddonInfo
25
	 */
26
	protected $addon_info;
27
28
	/**
29
	 * Create the UpsellModule using add-on info.
30
	 *
31
	 * @param \BulkWP\BulkDelete\Core\Addon\AddonInfo $addon_info Addon Info.
32
	 */
33
	public function __construct( $addon_info ) {
34
		$this->addon_info = $addon_info;
35
36
		$this->meta_box_slug = $this->addon_info->get_slug();
37
		$this->messages      = array(
38
			'box_label' => $addon_info->get_upsell_title(),
39
		);
40
	}
41
42
	public function render() {
43
		?>
44
45
		<p>
46
			<?php echo $this->addon_info->get_upsell_message(); ?>
47
			<a href="<?php echo esc_url( $this->addon_info->get_buy_url() ); ?>"><?php _e( 'Buy Now', 'bulk-delete' ); ?></a>
48
		</p>
49
50
		<?php
51
	}
52
53
	protected function initialize() {
54
		// Empty by design.
55
	}
56
57
	protected function parse_common_filters( $request ) {
58
		// Empty by design.
59
	}
60
61
	protected function convert_user_input_to_options( $request, $options ) {
62
		// Empty by design.
63
	}
64
65
	protected function get_success_message( $items_deleted ) {
66
		// Empty by design.
67
	}
68
69
	protected function do_delete( $options ) {
70
		// Empty by design.
71
	}
72
}
73