| 1 |
<?php |
| 2 |
/** |
| 3 |
* Email Report Settings Configuration |
| 4 |
* |
| 5 |
* Default stored state and section catalog for the Email Reporting feature. |
| 6 |
* |
| 7 |
* The free report is fixed: every 30 days, to the site admin email, with every |
| 8 |
* section. Only the on/off switch and the schedule timestamps are stored. |
| 9 |
* Schedule, recipients and branding settings belong to ThinkRank Pro, which |
| 10 |
* supplies them through the `thinkrank_email_report_config`, |
| 11 |
* `thinkrank_email_report_subject_template` and `thinkrank_email_report_payload` |
| 12 |
* filters (#673). |
| 13 |
* |
| 14 |
* @package ThinkRank |
| 15 |
* @subpackage Config |
| 16 |
* @since 1.9.0 |
| 17 |
*/ |
| 18 |
|
| 19 |
declare(strict_types=1); |
| 20 |
|
| 21 |
if (!defined('ABSPATH')) { |
| 22 |
exit; |
| 23 |
} |
| 24 |
|
| 25 |
/** |
| 26 |
* Default stored Email Reporting state. |
| 27 |
* |
| 28 |
* @return array{enabled: bool, next_scheduled_at: ?string, last_sent_at: ?string} |
| 29 |
*/ |
| 30 |
function thinkrank_get_default_email_report_config(): array { |
| 31 |
return [ |
| 32 |
'enabled' => false, |
| 33 |
'next_scheduled_at' => null, |
| 34 |
'last_sent_at' => null, |
| 35 |
]; |
| 36 |
} |
| 37 |
|
| 38 |
/** |
| 39 |
* Built-in sections, in render order. |
| 40 |
* |
| 41 |
* Keys here are the section identifiers used everywhere — in the |
| 42 |
* sections_enabled list of the resolved config, in the Section_Registry, and |
| 43 |
* in template paths. |
| 44 |
* |
| 45 |
* @return array<string,array{label:string}> |
| 46 |
*/ |
| 47 |
function thinkrank_get_email_report_default_sections(): array { |
| 48 |
return [ |
| 49 |
'key_metrics' => [ |
| 50 |
'label' => __('Key Metrics', 'thinkrank'), |
| 51 |
], |
| 52 |
'position_summary' => [ |
| 53 |
'label' => __('Position Summary', 'thinkrank'), |
| 54 |
], |
| 55 |
'top_winning_posts' => [ |
| 56 |
'label' => __('Top Winning Posts', 'thinkrank'), |
| 57 |
], |
| 58 |
'top_losing_posts' => [ |
| 59 |
'label' => __('Top Losing Posts', 'thinkrank'), |
| 60 |
], |
| 61 |
'top_winning_keywords' => [ |
| 62 |
'label' => __('Top Winning Keywords', 'thinkrank'), |
| 63 |
], |
| 64 |
'top_losing_keywords' => [ |
| 65 |
'label' => __('Top Losing Keywords', 'thinkrank'), |
| 66 |
], |
| 67 |
]; |
| 68 |
} |
| 69 |
|