| @@ -13,9 +13,9 @@ | ||
| 13 | 13 | * @wordpress-plugin |
| 14 | 14 | * Plugin Name: WebberZone Top 10 |
| 15 | 15 | * Plugin URI: https://webberzone.com/plugins/top-10/ |
| 16 | 16 | * Description: Count daily and total visits per post and display the most popular posts based on the number of views |
| 17 | - * Version: 4.3.1 | |
| 17 | + * Version: 4.5.1 | |
| 18 | 18 | * Author: WebberZone |
| 19 | 19 | * Author URI: https://webberzone.com |
| 20 | 20 | * License: GPL-2.0+ |
| 21 | 21 | * License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| @@ -35,9 +35,9 @@ | ||
| 35 | 35 | * |
| 36 | 36 | * @since 3.1.0 |
| 37 | 37 | */ |
| 38 | 38 | if ( ! defined( 'TOP_TEN_VERSION' ) ) { |
| 39 | - define( 'TOP_TEN_VERSION', '4.3.1' ); | |
| 39 | + define( 'TOP_TEN_VERSION', '4.5.1' ); | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * Holds the filesystem directory path (with trailing slash) for Top 10 |
| @@ -163,10 +163,16 @@ | ||
| 163 | 163 | * |
| 164 | 164 | * @var string |
| 165 | 165 | */ |
| 166 | 166 | global $tptn_db_version; |
| 167 | -$tptn_db_version = '7.0'; | |
| 167 | +$tptn_db_version = '7.3'; | |
| 168 | 168 | |
| 169 | +// Load the Composer autoloader (includes the Freemius SDK). | |
| 170 | +$composer_autoload = plugin_dir_path( __FILE__ ) . 'vendor/autoload.php'; | |
| 171 | +if ( file_exists( $composer_autoload ) ) { | |
| 172 | + require_once $composer_autoload; | |
| 173 | +} | |
| 174 | + | |
| 169 | 175 | if ( ! function_exists( __NAMESPACE__ . '\\tptn_freemius' ) ) { |
| 170 | 176 | // Load Freemius. |
| 171 | 177 | require_once plugin_dir_path( __FILE__ ) . 'load-freemius.php'; |
| 172 | 178 | } |
| @@ -174,8 +180,19 @@ | ||
| 174 | 180 | // Load the autoloader. |
| 175 | 181 | if ( ! function_exists( __NAMESPACE__ . '\\autoload' ) ) { |
| 176 | 182 | require_once plugin_dir_path( __FILE__ ) . 'includes/autoloader.php'; |
| 177 | 183 | } |
| 184 | + | |
| 185 | +// Load the CrawlerDetect library (bundled directly; not via the Composer autoloader). | |
| 186 | +$tptn_crawler_detect_src = plugin_dir_path( __FILE__ ) . 'vendor/jaybizzle/crawler-detect/src/'; | |
| 187 | +if ( ! class_exists( '\Jaybizzle\CrawlerDetect\CrawlerDetect' ) && is_dir( $tptn_crawler_detect_src ) ) { | |
| 188 | + require_once $tptn_crawler_detect_src . 'Fixtures/AbstractProvider.php'; | |
| 189 | + require_once $tptn_crawler_detect_src . 'Fixtures/Crawlers.php'; | |
| 190 | + require_once $tptn_crawler_detect_src . 'Fixtures/Exclusions.php'; | |
| 191 | + require_once $tptn_crawler_detect_src . 'Fixtures/Headers.php'; | |
| 192 | + require_once $tptn_crawler_detect_src . 'CrawlerDetect.php'; | |
| 193 | +} | |
| 194 | +unset( $tptn_crawler_detect_src ); | |
| 178 | 195 | |
| 179 | 196 | |
| 180 | 197 | if ( ! function_exists( __NAMESPACE__ . '\wz_top_ten' ) ) { |
| 181 | 198 | /** |