PluginProbe
404 Solution / trunk
404 Solution vtrunk
4.3.5 4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.2.0 4.1.19 4.1.18 4.1.17 4.1.16 4.1.15 4.1.13 4.1.12 4.1.11 4.1.10 4.1.9 4.1.8 4.1.7 4.1.6 4.1.5 4.1.4 4.1.3 trunk 2.30.0 All 109 releases
404-solution / includes / core / PluginLogicDefaults.php

PluginLogicDefaults.php in 404 Solution trunk, at includes/core/PluginLogicDefaults.php

121 lines 5.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3
4 if (!defined('ABSPATH')) {
5 exit;
6 }
7
8 /**
9 * Default values for the abj404_settings option array.
10 *
11 * Standalone class extracted from PluginLogic so the 80-line defaults
12 * literal does not bloat the controller. ABJ_404_Solution_PluginLogic::getDefaultOptions()
13 * forwards to {@see ABJ_404_Solution_PluginLogicDefaults::defaults()}.
14 *
15 * Defaults are merged into the persisted option on every read (see
16 * PluginLogic::getOptions()), so adding a new key here gives every existing
17 * install that key automatically without a migration.
18 *
19 * Referenced by:
20 * - PluginLogic::getOptions() (defaults merge)
21 * - PluginLogic::updateToNewVersionAction() (defaults merge prior to upgrade)
22 * - PluginLogicSettingsUpdate (per-row default fallback)
23 * - Ajax_RestoreDefaults (full reset to defaults)
24 * - ViewTrait_Shared (best-effort fallback when PluginLogic is unavailable)
25 */
26 class ABJ_404_Solution_PluginLogicDefaults {
27
28 /**
29 * Default abj404_settings array.
30 *
31 * Uses ABJ404_TYPE_404_DISPLAYED, which is defined by the bootstrap (see
32 * 404-solution.php); callers must require that constant before invoking.
33 *
34 * @return array<string, mixed>
35 */
36 public static function defaults(): array {
37 return array(
38 'default_redirect' => '301',
39 'send_error_logs' => '0',
40 'capture_404' => '1',
41 'capture_deletion' => 1095,
42 'manual_deletion' => '0',
43 'log_deletion' => '365',
44 'admin_notification' => '0',
45 'remove_matches' => '1',
46 'suggest_max' => '5',
47 'suggest_title' => '<h3>{suggest_title_text}</h3>',
48 'suggest_before' => '<ol>',
49 'suggest_after' => '</ol>',
50 'suggest_entrybefore' => '<li>',
51 'suggest_entryafter' => '</li>',
52 'suggest_noresults' => '<p>{suggest_noresults_text}</p>',
53 'suggest_cats' => '1',
54 'suggest_tags' => '1',
55 'suggest_minscore' => '25',
56 'suggest_minscore_enabled' => '0',
57 'update_suggest_url' => '0',
58 'auto_redirects' => '1',
59 'old_permalink_structure_redirects' => '1',
60 'auto_slugs' => '1',
61 'auto_trash_redirect' => '0',
62 'auto_score' => '90',
63 'auto_score_title' => '',
64 'auto_score_category_tag' => '',
65 'auto_score_content' => '',
66 'template_redirect_priority' => '9',
67 'auto_deletion' => '1095',
68 'auto_302_expiration_days' => '0',
69 'auto_cats' => '1',
70 'auto_tags' => '1',
71 'dest404page' => '0|' . ABJ404_TYPE_404_DISPLAYED,
72 'maximum_log_disk_usage' => '10',
73 'ignore_dontprocess' => 'zemanta aggregator',
74 'ignore_doprocess' => "Googlebot\nMediapartners-Google\nAdsBot-Google\ndevelopers.google.com\n"
75 . "Bingbot\nYahoo! Slurp\nDuckDuckBot\nBaiduspider\nYandexBot\nwww.sogou.com\nSogou-Test-Spider\n"
76 . "Exabot\nfacebot\nfacebookexternalhit\nia_archiver\nSeznamBot\nPinterestbot\nUptimeRobot\nMJ12bot",
77 'recognized_post_types' => "page\npost\nproduct",
78 'recognized_categories' => "",
79 'folders_files_ignore' => implode("\n", array("wp-content/plugins/*", "wp-content/themes/*",
80 ".well-known/acme-challenge/*")),
81 'folders_files_ignore_usable' => "",
82 'suggest_regex_exclusions' => "",
83 'suggest_regex_exclusions_usable' => "",
84 'plugin_admin_users' => "",
85 'debug_mode' => 0,
86 'days_wait_before_major_update' => 30,
87 'DB_VERSION' => '0.0.0',
88 'menuLocation' => 'underSettings',
89 'admin_theme' => 'default',
90 'plugin_language_override' => '',
91 'disable_auto_dark_mode' => '0',
92 'admin_notification_email' => '',
93 'admin_notification_frequency' => 'instant',
94 'admin_notification_digest_limit' => '10',
95 'admin_notification_last_sent' => '0',
96 'page_redirects_order_by' => 'url',
97 'page_redirects_order' => 'ASC',
98 'captured_order_by' => 'logshits',
99 'captured_order' => 'DESC',
100 'excludePages[]' => '',
101 'dest404_behavior' => 'theme_default',
102 'auto_trash_junk_urls' => '1',
103 'auto_trash_junk_patterns' => implode("\n", array(
104 '.env', '.git/', '.aws/', '.svn/', '.hg/',
105 'xmlrpc.php', 'wlwmanifest.xml',
106 'wp-config', 'config.php', 'config.json', 'config.bak',
107 'phpinfo', 'phpmyadmin', 'phpMyAdmin', 'adminer',
108 'sqladmin', 'dbadmin', 'mysqladmin',
109 'id_rsa', '.bash_history', '.bashrc', '.DS_Store',
110 'nginx.conf', 'httpd.conf', 'Dockerfile', 'docker-compose',
111 '.sql', '.tar.gz', 'db_backup', 'database_backup',
112 'setup-config.php',
113 '/vendor/', '/node_modules/', '/tmp/',
114 '/_profiler/', '/_debugbar/', '/debug/', '/debugbar/',
115 '/META-INF/', '/WEB-INF/',
116 'magento_version', 'alfa-rex.php', 'bypass.php',
117 )),
118 );
119 }
120 }
121