config.wordpress.php
120 lines
| 1 | <?php |
| 2 | |
| 3 | global $wp_version, $wpdb; |
| 4 | define('SG_ENV_WORDPRESS', 'Wordpress'); |
| 5 | define('SG_ENV_MAGENTO', 'Magento'); |
| 6 | define('SG_ENV_VERSION', $wp_version); |
| 7 | define('SG_ENV_ADAPTER', SG_ENV_WORDPRESS); |
| 8 | define('SG_ENV_DB_PREFIX', $wpdb->prefix); |
| 9 | |
| 10 | require_once(dirname(__FILE__).'/config.php'); |
| 11 | |
| 12 | define('SG_ENV_CORE_TABLE', SG_WORDPRESS_CORE_TABLE); |
| 13 | //Database |
| 14 | define('SG_DB_ADAPTER', SG_ENV_ADAPTER); |
| 15 | define('SG_DB_NAME', $wpdb->dbname); |
| 16 | define('SG_BACKUP_DATABASE_EXCLUDE', SG_ACTION_TABLE_NAME.','.SG_CONFIG_TABLE_NAME.','.SG_SCHEDULE_TABLE_NAME); |
| 17 | |
| 18 | |
| 19 | define('SG_MAIL_TEMPLATES_PATH', realpath(SG_APP_PATH.'../public/templates').'/'); |
| 20 | define('SG_MAIL_BACKUP_TEMPLATE', 'mail_backup.php'); |
| 21 | define('SG_MAIL_RESTORE_TEMPLATE', 'mail_restore.php'); |
| 22 | define('SG_MAIL_UPLOAD_TEMPLATE', 'mail_upload.php'); |
| 23 | |
| 24 | //Notice |
| 25 | define('SG_NOTICE_TEMPLATES_PATH', realpath(SG_APP_PATH.'../public/templates/notices').'/'); |
| 26 | |
| 27 | //BackupGuard SDK |
| 28 | define('SG_BACKUPGUARD_CLIENT_ID', 'wordpress'); |
| 29 | define('SG_BACKUPGUARD_CLIENT_SECRET', 'AAPQEgsyQrt6wqDBk7fpa24NP6W43evtayxXmUqS'); |
| 30 | |
| 31 | //Backup |
| 32 | $wpContent = basename(WP_CONTENT_DIR); |
| 33 | $wpPlugins = basename(WP_PLUGIN_DIR); |
| 34 | $wpThemes = basename(get_theme_root()); |
| 35 | |
| 36 | $upload_dir = wp_upload_dir(); |
| 37 | $wpUploads = basename($upload_dir['basedir']); |
| 38 | |
| 39 | $dbCharset = 'utf8'; |
| 40 | if (@constant("DB_CHARSET")) { |
| 41 | $dbCharset = DB_CHARSET; |
| 42 | } |
| 43 | |
| 44 | //Define same constants in magento config file |
| 45 | define('SG_UPLOAD_PATH', $upload_dir['basedir']); |
| 46 | define('SG_UPLOAD_URL', $upload_dir['baseurl']); |
| 47 | define('SG_SITE_URL', get_site_url()); |
| 48 | define('SG_HOME_URL', get_home_url()); |
| 49 | define('SG_DB_CHARSET', $dbCharset); |
| 50 | define('SG_MYSQL_VERSION', $wpdb->db_version()); |
| 51 | |
| 52 | $type = "standard"; |
| 53 | |
| 54 | if (is_multisite()) { |
| 55 | $type = "multisite"; |
| 56 | } |
| 57 | |
| 58 | define('SG_SITE_TYPE', $type); |
| 59 | |
| 60 | define('SG_PING_FILE_PATH', $upload_dir['basedir'].'/backup-guard/ping.json'); |
| 61 | |
| 62 | //Symlink download |
| 63 | define('SG_SYMLINK_PATH', $upload_dir['basedir'].'/sg_symlinks/'); |
| 64 | define('SG_SYMLINK_URL', $upload_dir['baseurl'].'/sg_symlinks/'); |
| 65 | |
| 66 | define('SG_APP_ROOT_DIRECTORY', realpath(dirname(WP_CONTENT_DIR)."/")); //Wordpress Define |
| 67 | |
| 68 | $sgBackupFilePathsExclude = array( |
| 69 | $wpContent.'/'.$wpPlugins.'/backup/', |
| 70 | $wpContent.'/'.$wpPlugins.'/backup-guard-pro/', |
| 71 | $wpContent.'/'.$wpPlugins.'/backup-guard-silver/', |
| 72 | $wpContent.'/'.$wpPlugins.'/backup-guard-gold/', |
| 73 | $wpContent.'/'.$wpPlugins.'/backup-guard-platinum/', |
| 74 | $wpContent.'/'.$wpUploads.'/backup-guard/', |
| 75 | $wpContent.'/'.$wpUploads.'/sg_symlinks/', |
| 76 | $wpContent.'/ai1wm-backups/', |
| 77 | $wpContent.'/aiowps_backups/', |
| 78 | $wpContent.'/Dropbox_Backup/', |
| 79 | $wpContent.'/updraft/', |
| 80 | $wpContent.'/upsupsystic/', |
| 81 | $wpContent.'/wpbackitup_backups/', |
| 82 | $wpContent.'/wpbackitup_restore/', |
| 83 | $wpContent.'/backups/', |
| 84 | $wpContent.'/cache/', |
| 85 | $wpContent.'/'.$wpUploads.'/wp-clone/', |
| 86 | $wpContent.'/'.$wpUploads.'/wp-staging/', |
| 87 | $wpContent.'/'.$wpUploads.'/wp-migrate-db/', |
| 88 | $wpContent.'/'.$wpUploads.'/db-backup/', |
| 89 | $wpContent.'/'.$wpPlugins.'/wordpress-move/backup/', |
| 90 | $wpContent.'/as3b_backups/', |
| 91 | $wpContent.'/'.$wpUploads.'/backupbuddy_backups/', |
| 92 | $wpContent.'/backups-dup-pro/', |
| 93 | $wpContent.'/managewp/backups/', |
| 94 | $wpContent.'/'.$wpUploads.'/backupbuddy_temp/', |
| 95 | $wpContent.'/'.$wpUploads.'/pb_backupbuddy/', |
| 96 | $wpContent.'/'.$wpUploads.'/snapshots/', |
| 97 | $wpContent.'/debug.log', |
| 98 | $wpContent.'/backup-db/' |
| 99 | ); |
| 100 | |
| 101 | define('SG_BACKUP_FILE_PATHS_EXCLUDE', implode(',', $sgBackupFilePathsExclude)); |
| 102 | define('SG_BACKUP_DIRECTORY', $upload_dir['basedir'].'/backup-guard/'); //backups will be stored here |
| 103 | define('SG_BACKUP_DIRECTORY_URL', SG_UPLOAD_URL.'/backup-guard/'); |
| 104 | |
| 105 | //Storage |
| 106 | define('SG_STORAGE_UPLOAD_CRON', ''); |
| 107 | |
| 108 | define('SG_BACKUP_FILE_PATHS', $wpContent.','.$wpContent.'/'.$wpPlugins.','.$wpContent.'/'.$wpThemes.','.$wpContent.'/'.$wpUploads); |
| 109 | |
| 110 | define('SG_WP_OPTIONS_MIGRATABLE_VALUES', 'user_roles'); |
| 111 | define('SG_WP_USERMETA_MIGRATABLE_VALUES', 'capabilities,user_level,dashboard_quick_press_last_post_id,user-settings,user-settings-time'); |
| 112 | define('SG_MISC_MIGRATABLE_TABLES', SG_ENV_DB_PREFIX.'options,'.SG_ENV_DB_PREFIX.'usermeta'); |
| 113 | define('SG_MULTISITE_TABLES_TO_MIGRATE', SG_ENV_DB_PREFIX.'blogs,'.SG_ENV_DB_PREFIX.'site'); |
| 114 | define('SG_SUBDOMAIN_INSTALL', defined('SUBDOMAIN_INSTALL')?SUBDOMAIN_INSTALL:false); |
| 115 | |
| 116 | |
| 117 | define('SG_BACKUP_PRODUCTS_URL', 'https://backup-guard.com/admin/products/view'); |
| 118 | |
| 119 | define('SG_BACKUP_GUARD_SECURITY_EXTENSION', 'backup-guard-security'); |
| 120 |