PluginProbe ʕ •ᴥ•ʔ
All in One SEO – Powerful SEO Plugin to Boost SEO Rankings & Increase Traffic / trunk
All in One SEO – Powerful SEO Plugin to Boost SEO Rankings & Increase Traffic vtrunk
4.9.7.2 4.9.7.1 4.9.6.2 4.9.6.1 trunk 4.7.8 4.7.9 4.7.9.1 4.8.0 4.8.1 4.8.1.1 4.8.2 4.8.3.1 4.8.3.2 4.8.4.1 4.8.5 4.8.6 4.8.6.1 4.8.7.2 4.8.8 4.8.9 4.9.0 4.9.1 4.9.1.1 4.9.2 4.9.3 4.9.4.1 4.9.5 4.9.5.1
all-in-one-seo-pack / app / Common / Core / Core.php
all-in-one-seo-pack / app / Common / Core Last commit date
Core.php 3 weeks ago
Core.php
157 lines
1 <?php
2 namespace AIOSEO\Plugin\Common\Core;
3
4 // Exit if accessed directly.
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit;
7 }
8
9 use AIOSEO\Plugin\Common\Options;
10 use AIOSEO\Plugin\Common\Utils;
11
12 /**
13 * Loads core classes.
14 *
15 * @since 4.1.9
16 */
17 class Core {
18 /**
19 * List of AIOSEO tables.
20 *
21 * @since 4.2.5
22 *
23 * @var array
24 */
25 private $aioseoTables = [
26 'aioseo_cache',
27 'aioseo_crawl_cleanup_blocked_args',
28 'aioseo_crawl_cleanup_logs',
29 'aioseo_links',
30 'aioseo_links_suggestions',
31 'aioseo_notifications',
32 'aioseo_posts',
33 'aioseo_redirects',
34 'aioseo_redirects_404',
35 'aioseo_redirects_404_logs',
36 'aioseo_redirects_hits',
37 'aioseo_redirects_logs',
38 'aioseo_terms',
39 'aioseo_search_statistics_objects',
40 'aioseo_search_statistics_keywords',
41 'aioseo_search_statistics_keyword_groups',
42 'aioseo_search_statistics_keyword_relationships',
43 'aioseo_revisions',
44 'aioseo_seo_analyzer_objects',
45 'aioseo_seo_analyzer_results',
46 'aioseo_writing_assistant_keywords',
47 'aioseo_writing_assistant_posts',
48 'aioseo_ai_insights_keyword_reports'
49 ];
50
51 /**
52 * Filesystem class instance.
53 *
54 * @since 4.2.7
55 *
56 * @var Utils\Filesystem
57 */
58 public $fs = null;
59
60 /**
61 * Assets class instance.
62 *
63 * @since 4.2.7
64 *
65 * @var Utils\Assets
66 */
67 public $assets = null;
68
69 /**
70 * DB class instance.
71 *
72 * @since 4.2.7
73 *
74 * @var Utils\Database
75 */
76 public $db = null;
77
78 /**
79 * Cache class instance.
80 *
81 * @since 4.2.7
82 *
83 * @var Utils\Cache
84 */
85 public $cache = null;
86
87 /**
88 * NetworkCache class instance.
89 *
90 * @since 4.2.7
91 *
92 * @var Utils\NetworkCache
93 */
94 public $networkCache = null;
95
96 /**
97 * Options Cache class instance.
98 *
99 * @since 4.2.7
100 *
101 * @var Options\Cache
102 */
103 public $optionsCache = null;
104
105 /**
106 * Class constructor.
107 *
108 * @since 4.1.9
109 */
110 public function __construct() {
111 $this->fs = new Utils\Filesystem( $this );
112 $this->assets = new Utils\Assets( $this );
113 $this->db = new Utils\Database();
114 $this->cache = new Utils\Cache();
115 $this->networkCache = new Utils\NetworkCache();
116 $this->optionsCache = new Options\Cache();
117 }
118
119 /**
120 * Get all the DB tables with prefix.
121 *
122 * @since 4.2.5
123 *
124 * @return array An array of tables.
125 */
126 public function getDbTables() {
127 global $wpdb;
128
129 $tables = [];
130 foreach ( $this->aioseoTables as $tableName ) {
131 $tables[] = $wpdb->prefix . $tableName;
132 }
133
134 return $tables;
135 }
136
137 /**
138 * Check if the current request is uninstalling (deleting) AIOSEO.
139 *
140 * @since 4.3.7
141 *
142 * @return bool Whether AIOSEO is being uninstalled/deleted or not.
143 */
144 public function isUninstalling() {
145 if (
146 defined( 'AIOSEO_FILE' ) &&
147 defined( 'WP_UNINSTALL_PLUGIN' )
148 ) {
149 // Make sure `plugin_basename()` exists.
150 include_once ABSPATH . 'wp-admin/includes/plugin.php';
151
152 return WP_UNINSTALL_PLUGIN === plugin_basename( AIOSEO_FILE );
153 }
154
155 return false;
156 }
157 }