| 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 |
'auto_slugs' => '1', |
| 60 |
'auto_trash_redirect' => '0', |
| 61 |
'auto_score' => '90', |
| 62 |
'auto_score_title' => '', |
| 63 |
'auto_score_category_tag' => '', |
| 64 |
'auto_score_content' => '', |
| 65 |
'template_redirect_priority' => '9', |
| 66 |
'auto_deletion' => '1095', |
| 67 |
'auto_302_expiration_days' => '0', |
| 68 |
'auto_cats' => '1', |
| 69 |
'auto_tags' => '1', |
| 70 |
'dest404page' => '0|' . ABJ404_TYPE_404_DISPLAYED, |
| 71 |
'maximum_log_disk_usage' => '10', |
| 72 |
'ignore_dontprocess' => 'zemanta aggregator', |
| 73 |
'ignore_doprocess' => "Googlebot\nMediapartners-Google\nAdsBot-Google\ndevelopers.google.com\n" |
| 74 |
. "Bingbot\nYahoo! Slurp\nDuckDuckBot\nBaiduspider\nYandexBot\nwww.sogou.com\nSogou-Test-Spider\n" |
| 75 |
. "Exabot\nfacebot\nfacebookexternalhit\nia_archiver\nSeznamBot\nPinterestbot\nUptimeRobot\nMJ12bot", |
| 76 |
'recognized_post_types' => "page\npost\nproduct", |
| 77 |
'recognized_categories' => "", |
| 78 |
'folders_files_ignore' => implode("\n", array("wp-content/plugins/*", "wp-content/themes/*", |
| 79 |
".well-known/acme-challenge/*")), |
| 80 |
'folders_files_ignore_usable' => "", |
| 81 |
'suggest_regex_exclusions' => "", |
| 82 |
'suggest_regex_exclusions_usable' => "", |
| 83 |
'plugin_admin_users' => "", |
| 84 |
'debug_mode' => 0, |
| 85 |
'days_wait_before_major_update' => 30, |
| 86 |
'DB_VERSION' => '0.0.0', |
| 87 |
'menuLocation' => 'underSettings', |
| 88 |
'admin_theme' => 'default', |
| 89 |
'plugin_language_override' => '', |
| 90 |
'disable_auto_dark_mode' => '0', |
| 91 |
'admin_notification_email' => '', |
| 92 |
'admin_notification_frequency' => 'instant', |
| 93 |
'admin_notification_digest_limit' => '10', |
| 94 |
'admin_notification_last_sent' => '0', |
| 95 |
'page_redirects_order_by' => 'url', |
| 96 |
'page_redirects_order' => 'ASC', |
| 97 |
'captured_order_by' => 'logshits', |
| 98 |
'captured_order' => 'DESC', |
| 99 |
'excludePages[]' => '', |
| 100 |
'dest404_behavior' => 'theme_default', |
| 101 |
'auto_trash_junk_urls' => '1', |
| 102 |
'auto_trash_junk_patterns' => implode("\n", array( |
| 103 |
'.env', '.git/', '.aws/', '.svn/', '.hg/', |
| 104 |
'xmlrpc.php', 'wlwmanifest.xml', |
| 105 |
'wp-config', 'config.php', 'config.json', 'config.bak', |
| 106 |
'phpinfo', 'phpmyadmin', 'phpMyAdmin', 'adminer', |
| 107 |
'sqladmin', 'dbadmin', 'mysqladmin', |
| 108 |
'id_rsa', '.bash_history', '.bashrc', '.DS_Store', |
| 109 |
'nginx.conf', 'httpd.conf', 'Dockerfile', 'docker-compose', |
| 110 |
'.sql', '.tar.gz', 'db_backup', 'database_backup', |
| 111 |
'setup-config.php', |
| 112 |
'/vendor/', '/node_modules/', '/tmp/', |
| 113 |
'/_profiler/', '/_debugbar/', '/debug/', '/debugbar/', |
| 114 |
'/META-INF/', '/WEB-INF/', |
| 115 |
'magento_version', 'alfa-rex.php', 'bypass.php', |
| 116 |
)), |
| 117 |
); |
| 118 |
} |
| 119 |
} |
| 120 |
|