Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/hostinge.../includes/Admin
File: Partnership.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Hostinger\EasyOnboarding\Admin;
[2] Fix | Delete
class Partnership {
[3] Fix | Delete
const MONSTERINSIGHTS_PARTNER_ID = 590;
[4] Fix | Delete
const ASTRA_PARTNER_ID = '12425';
[5] Fix | Delete
const WPFORMS_PARTNER_REF = 49;
[6] Fix | Delete
const AIOSEO_PARTNER_REF = 66;
[7] Fix | Delete
const HESTIA_AND_NEVE_PARTNER_LINK = 'https://www.shareasale.com/r.cfm?b=642802&u=3107422&m=55096';
[8] Fix | Delete
[9] Fix | Delete
public function __construct() {
[10] Fix | Delete
if ( is_admin() ) {
[11] Fix | Delete
$this->define_admin_hooks();
[12] Fix | Delete
}
[13] Fix | Delete
[14] Fix | Delete
add_action( 'init', array( $this, 'schedule_weekly_cron_job' ) );
[15] Fix | Delete
}
[16] Fix | Delete
[17] Fix | Delete
public function partner_astra() {
[18] Fix | Delete
add_option( 'astra_partner_url_param', self::ASTRA_PARTNER_ID, '', 'no' );
[19] Fix | Delete
}
[20] Fix | Delete
[21] Fix | Delete
public function partner_monsterinsights( $id ) {
[22] Fix | Delete
return self::MONSTERINSIGHTS_PARTNER_ID;
[23] Fix | Delete
}
[24] Fix | Delete
[25] Fix | Delete
public function wpforms_upgrade_link( $link ) {
[26] Fix | Delete
return add_query_arg( 'ref', self::WPFORMS_PARTNER_REF, $link );
[27] Fix | Delete
}
[28] Fix | Delete
[29] Fix | Delete
public function aioseo_upgrade_link( $link ) {
[30] Fix | Delete
return add_query_arg( 'ref', self::AIOSEO_PARTNER_REF, $link );
[31] Fix | Delete
}
[32] Fix | Delete
[33] Fix | Delete
public function monsterinsights_upgrade_link( $link ) {
[34] Fix | Delete
return add_query_arg( 'ref', self::MONSTERINSIGHTS_PARTNER_ID, $link );
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
public function neve_or_hestia_upgrade_link( $utmify_url, $url ) {
[38] Fix | Delete
if ( strpos( $url, 'themes/neve/upgrade' ) !== false || strpos( $url, 'themes/hestia-pro/upgrade' ) !== false ) {
[39] Fix | Delete
return self::HESTIA_AND_NEVE_PARTNER_LINK;
[40] Fix | Delete
}
[41] Fix | Delete
[42] Fix | Delete
return $utmify_url;
[43] Fix | Delete
}
[44] Fix | Delete
[45] Fix | Delete
private function define_admin_hooks() {
[46] Fix | Delete
add_filter( 'monsterinsights_shareasale_id', array( $this, 'partner_monsterinsights' ) );
[47] Fix | Delete
add_filter( 'monsterinsights_upgrade_link', array( $this, 'monsterinsights_upgrade_link' ) );
[48] Fix | Delete
add_filter( 'wpforms_upgrade_link', array( $this, 'wpforms_upgrade_link' ) );
[49] Fix | Delete
add_filter( 'aioseo_upgrade_link', array( $this, 'aioseo_upgrade_link' ) );
[50] Fix | Delete
add_filter( 'tsdk_utmify_url_neve', array( $this, 'neve_or_hestia_upgrade_link' ), 11, 2 );
[51] Fix | Delete
add_filter( 'tsdk_utmify_url_hestia-pro', array( $this, 'neve_or_hestia_upgrade_link' ), 11, 2 );
[52] Fix | Delete
}
[53] Fix | Delete
[54] Fix | Delete
public function schedule_weekly_cron_job() {
[55] Fix | Delete
if ( ! wp_next_scheduled( 'run_weekly_partner_astra' ) ) {
[56] Fix | Delete
wp_schedule_event( time(), 'weekly', 'run_weekly_partner_astra' );
[57] Fix | Delete
}
[58] Fix | Delete
add_action( 'run_weekly_partner_astra', array( $this, 'run_weekly_partner_astra' ) );
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
public function run_weekly_partner_astra() {
[62] Fix | Delete
if ( ! get_option( 'astra_partner_url_param' ) ) {
[63] Fix | Delete
$this->partner_astra();
[64] Fix | Delete
}
[65] Fix | Delete
}
[66] Fix | Delete
}
[67] Fix | Delete
[68] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function