| @@ -99,10 +99,17 @@ | ||
| 99 | 99 | /* translators: %s: Total revenue formatted as currency. */ |
| 100 | 100 | $message = sprintf( __( "You've earned %s with CartFlows in the last 30 days.", 'cartflows' ), wp_strip_all_tags( str_replace( ' ', ' ', wc_price( (float) $stats['total_revenue_raw'] ) ) ) ); |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - $report_url = admin_url( 'admin.php?page=cartflows&path=home' ); | |
| 104 | - $upgrade_url = $this->get_utm_url( 'https://cartflows.com/pricing/', 'dashboard-widget-card' ); | |
| 103 | + $report_url = admin_url( 'admin.php?page=cartflows&path=analytics' ); | |
| 104 | + $upgrade_url = \Cartflows_Helper::get_upgrade_to_pro_link( | |
| 105 | + 'pricing', | |
| 106 | + '', | |
| 107 | + array( | |
| 108 | + 'utm_source' => 'plugin-page', | |
| 109 | + 'utm_campaign' => 'dashboard-widget-card', | |
| 110 | + ) | |
| 111 | + ); | |
| 105 | 112 | ?> |
| 106 | 113 | <div class="wcf-dash-widget"> |
| 107 | 114 | <div class="wcf-dash-header"> |
| 108 | 115 | <div class="wcf-dash-titles"> |
| @@ -135,12 +142,37 @@ | ||
| 135 | 142 | </div> |
| 136 | 143 | |
| 137 | 144 | <div class="wcf-dash-footer"> |
| 138 | 145 | <?php if ( $locked ) : ?> |
| 139 | - <a href="<?php echo esc_url( $this->get_utm_url( 'https://cartflows.com/pricing/', 'dashboard-widget-upgrade' ) ); ?>" target="_blank" rel="noopener noreferrer" class="button button-primary"><?php esc_html_e( 'Upgrade to Pro', 'cartflows' ); ?></a> | |
| 146 | + <a href=" | |
| 147 | + <?php | |
| 148 | + echo esc_url( | |
| 149 | + \Cartflows_Helper::get_upgrade_to_pro_link( | |
| 150 | + 'pricing', | |
| 151 | + '', | |
| 152 | + array( | |
| 153 | + 'utm_source' => 'plugin-page', | |
| 154 | + 'utm_campaign' => 'dashboard-widget-upgrade', | |
| 155 | + ) | |
| 156 | + ) | |
| 157 | + ); | |
| 158 | + ?> | |
| 159 | + " target="_blank" rel="noopener noreferrer" class="button button-primary"><?php esc_html_e( 'Upgrade to Pro', 'cartflows' ); ?></a> | |
| 140 | 160 | <?php endif; ?> |
| 141 | 161 | <div class="wcf-dash-footer-links"> |
| 142 | - <a href="<?php echo esc_url( $this->get_utm_url( 'https://cartflows.com/docs/', 'dashboard-widget-help' ) ); ?>" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Help & Tutorials', 'cartflows' ); ?></a> | |
| 162 | + <a href=" | |
| 163 | + <?php | |
| 164 | + echo esc_url( | |
| 165 | + \Cartflows_Helper::get_kb_doc_link( | |
| 166 | + 'https://cartflows.com/docs/', | |
| 167 | + array( | |
| 168 | + 'utm_source' => 'plugin-page', | |
| 169 | + 'utm_campaign' => 'dashboard-widget-help', | |
| 170 | + ) | |
| 171 | + ) | |
| 172 | + ); | |
| 173 | + ?> | |
| 174 | + " target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Help & Tutorials', 'cartflows' ); ?></a> | |
| 143 | 175 | </div> |
| 144 | 176 | </div> |
| 145 | 177 | |
| 146 | 178 | <?php $this->render_inline_styles(); ?> |
| @@ -208,27 +240,8 @@ | ||
| 208 | 240 | * @return bool True when running on free or unlicensed Pro. |
| 209 | 241 | */ |
| 210 | 242 | private function show_locked_cards() { |
| 211 | 243 | return ! ( _is_cartflows_pro() && is_wcf_pro_plan() ); |
| 212 | - } | |
| 213 | - | |
| 214 | - /** | |
| 215 | - * Build a CartFlows.com URL with UTM parameters appended. | |
| 216 | - * | |
| 217 | - * @since 2.2.3 | |
| 218 | - * @param string $base Destination base URL. | |
| 219 | - * @param string $campaign UTM campaign slug. | |
| 220 | - * @return string Full URL with UTM query parameters. | |
| 221 | - */ | |
| 222 | - private function get_utm_url( $base, $campaign ) { | |
| 223 | - return add_query_arg( | |
| 224 | - array( | |
| 225 | - 'utm_source' => 'plugin-page', | |
| 226 | - 'utm_medium' => 'free-cartflows', | |
| 227 | - 'utm_campaign' => $campaign, | |
| 228 | - ), | |
| 229 | - $base | |
| 230 | - ); | |
| 231 | 244 | } |
| 232 | 245 | |
| 233 | 246 | /** |
| 234 | 247 | * Render a single stat card. |