Changeset 1367419
- Timestamp:
- 03/09/2016 09:16:06 AM (10 years ago)
- Location:
- tweet-wheel
- Files:
-
- 22 deleted
- 6 edited
- 50 copied
-
tags/1.0.3.2 (copied) (copied from tweet-wheel/trunk)
-
tags/1.0.3.2/Licensing (copied) (copied from tweet-wheel/trunk/Licensing)
-
tags/1.0.3.2/assets/css/sf-styles.css (deleted)
-
tags/1.0.3.2/assets/css/tweet-wheel.css (deleted)
-
tags/1.0.3.2/assets/css/twp-calendar.css (copied) (copied from tweet-wheel/trunk/assets/css/twp-calendar.css)
-
tags/1.0.3.2/assets/css/twp-widget-admin.css (copied) (copied from tweet-wheel/trunk/assets/css/twp-widget-admin.css)
-
tags/1.0.3.2/assets/css/twp-widget.css (copied) (copied from tweet-wheel/trunk/assets/css/twp-widget.css)
-
tags/1.0.3.2/assets/css/twp.css (copied) (copied from tweet-wheel/trunk/assets/css/twp.css)
-
tags/1.0.3.2/assets/css/vendor (copied) (copied from tweet-wheel/trunk/assets/css/vendor)
-
tags/1.0.3.2/assets/fonts (copied) (copied from tweet-wheel/trunk/assets/fonts)
-
tags/1.0.3.2/assets/images/about-page (copied) (copied from tweet-wheel/trunk/assets/images/about-page)
-
tags/1.0.3.2/assets/images/ajax-loader.gif (copied) (copied from tweet-wheel/trunk/assets/images/ajax-loader.gif)
-
tags/1.0.3.2/assets/images/arrows.png (copied) (copied from tweet-wheel/trunk/assets/images/arrows.png)
-
tags/1.0.3.2/assets/images/featured-image.png (deleted)
-
tags/1.0.3.2/assets/images/go-pro (copied) (copied from tweet-wheel/trunk/assets/images/go-pro)
-
tags/1.0.3.2/assets/images/multitemplate.png (deleted)
-
tags/1.0.3.2/assets/images/queue-explained.png (deleted)
-
tags/1.0.3.2/assets/images/scheduling.png (deleted)
-
tags/1.0.3.2/assets/images/tweet-wheel-menu-icon.png (deleted)
-
tags/1.0.3.2/assets/images/twp-queue-bg.png (copied) (copied from tweet-wheel/trunk/assets/images/twp-queue-bg.png)
-
tags/1.0.3.2/assets/images/twp-white-spinner_20x20.png (copied) (copied from tweet-wheel/trunk/assets/images/twp-white-spinner_20x20.png)
-
tags/1.0.3.2/assets/images/twp-white-spinner_40x40.png (copied) (copied from tweet-wheel/trunk/assets/images/twp-white-spinner_40x40.png)
-
tags/1.0.3.2/assets/js/autosize.js (deleted)
-
tags/1.0.3.2/assets/js/bootstrap-tooltip.js (deleted)
-
tags/1.0.3.2/assets/js/jquery.validate.min.js (deleted)
-
tags/1.0.3.2/assets/js/select2 (deleted)
-
tags/1.0.3.2/assets/js/sf-jquery.js (deleted)
-
tags/1.0.3.2/assets/js/tweet-templates.js (deleted)
-
tags/1.0.3.2/assets/js/tweet-wheel.js (deleted)
-
tags/1.0.3.2/assets/js/twp-functions.js (copied) (copied from tweet-wheel/trunk/assets/js/twp-functions.js)
-
tags/1.0.3.2/assets/js/twp-helpers.js (copied) (copied from tweet-wheel/trunk/assets/js/twp-helpers.js)
-
tags/1.0.3.2/assets/js/twp-queues.js (copied) (copied from tweet-wheel/trunk/assets/js/twp-queues.js)
-
tags/1.0.3.2/assets/js/twp-schedule.js (copied) (copied from tweet-wheel/trunk/assets/js/twp-schedule.js)
-
tags/1.0.3.2/assets/js/twp-templates.js (copied) (copied from tweet-wheel/trunk/assets/js/twp-templates.js)
-
tags/1.0.3.2/assets/js/twp-widget.js (copied) (copied from tweet-wheel/trunk/assets/js/twp-widget.js)
-
tags/1.0.3.2/assets/js/twp.js (copied) (copied from tweet-wheel/trunk/assets/js/twp.js)
-
tags/1.0.3.2/assets/js/vendor (copied) (copied from tweet-wheel/trunk/assets/js/vendor)
-
tags/1.0.3.2/contributors.txt (copied) (copied from tweet-wheel/trunk/contributors.txt)
-
tags/1.0.3.2/i18n (copied) (copied from tweet-wheel/trunk/i18n)
-
tags/1.0.3.2/includes/admin (deleted)
-
tags/1.0.3.2/includes/classes (copied) (copied from tweet-wheel/trunk/includes/classes)
-
tags/1.0.3.2/includes/classes/class-twp-install.php (deleted)
-
tags/1.0.3.2/includes/classes/class-twp-license.php (deleted)
-
tags/1.0.3.2/includes/classes/class-twp-menus.php (copied) (copied from tweet-wheel/trunk/includes/classes/class-twp-menus.php) (2 diffs)
-
tags/1.0.3.2/includes/classes/class-twp-posts.php (copied) (copied from tweet-wheel/trunk/includes/classes/class-twp-posts.php)
-
tags/1.0.3.2/includes/classes/class-twp-queue.php (copied) (copied from tweet-wheel/trunk/includes/classes/class-twp-queue.php)
-
tags/1.0.3.2/includes/classes/class-twp-queues.php (copied) (copied from tweet-wheel/trunk/includes/classes/class-twp-queues.php) (1 diff)
-
tags/1.0.3.2/includes/classes/class-twp-schedule.php (copied) (copied from tweet-wheel/trunk/includes/classes/class-twp-schedule.php)
-
tags/1.0.3.2/includes/classes/class-twp-tweet.php (copied) (copied from tweet-wheel/trunk/includes/classes/class-twp-tweet.php)
-
tags/1.0.3.2/includes/classes/class-twp-widget.php (copied) (copied from tweet-wheel/trunk/includes/classes/class-twp-widget.php)
-
tags/1.0.3.2/includes/helpers.php (copied) (copied from tweet-wheel/trunk/includes/helpers.php) (1 diff)
-
tags/1.0.3.2/includes/install.php (deleted)
-
tags/1.0.3.2/includes/libraries/envato (copied) (copied from tweet-wheel/trunk/includes/libraries/envato)
-
tags/1.0.3.2/includes/libraries/sf-settings.php (copied) (copied from tweet-wheel/trunk/includes/libraries/sf-settings.php)
-
tags/1.0.3.2/includes/libraries/twitteroauth/.gitignore (copied) (copied from tweet-wheel/trunk/includes/libraries/twitteroauth/.gitignore)
-
tags/1.0.3.2/includes/libraries/twitteroauth/autoload.php (copied) (copied from tweet-wheel/trunk/includes/libraries/twitteroauth/autoload.php)
-
tags/1.0.3.2/includes/libraries/twitteroauth/autoloader.php (deleted)
-
tags/1.0.3.2/includes/libraries/twitteroauth/src/TwitterOAuth.php (copied) (copied from tweet-wheel/trunk/includes/libraries/twitteroauth/src/TwitterOAuth.php)
-
tags/1.0.3.2/includes/libraries/wp-updates-plugin.php (copied) (copied from tweet-wheel/trunk/includes/libraries/wp-updates-plugin.php)
-
tags/1.0.3.2/includes/tw-ajax.php (deleted)
-
tags/1.0.3.2/includes/twp-metaboxes.php (copied) (copied from tweet-wheel/trunk/includes/twp-metaboxes.php)
-
tags/1.0.3.2/includes/uninstall.php (copied) (copied from tweet-wheel/trunk/includes/uninstall.php) (2 diffs)
-
tags/1.0.3.2/includes/views (copied) (copied from tweet-wheel/trunk/includes/views)
-
tags/1.0.3.2/includes/views/about-support.php (copied) (copied from tweet-wheel/trunk/includes/views/about-support.php)
-
tags/1.0.3.2/includes/views/about.php (copied) (copied from tweet-wheel/trunk/includes/views/about.php)
-
tags/1.0.3.2/includes/views/auth.php (copied) (copied from tweet-wheel/trunk/includes/views/auth.php)
-
tags/1.0.3.2/includes/views/queues.php (copied) (copied from tweet-wheel/trunk/includes/views/queues.php)
-
tags/1.0.3.2/index.php (copied) (copied from tweet-wheel/trunk/index.php)
-
tags/1.0.3.2/readme.txt (copied) (copied from tweet-wheel/trunk/readme.txt) (3 diffs)
-
tags/1.0.3.2/tweet-wheel.php (copied) (copied from tweet-wheel/trunk/tweet-wheel.php) (9 diffs)
-
tags/1.0.3.2/tweetwheel.php (deleted)
-
trunk/includes/classes/class-twp-install.php (deleted)
-
trunk/includes/classes/class-twp-menus.php (modified) (2 diffs)
-
trunk/includes/classes/class-twp-queues.php (modified) (1 diff)
-
trunk/includes/helpers.php (modified) (1 diff)
-
trunk/includes/uninstall.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/tweet-wheel.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tweet-wheel/tags/1.0.3.2/includes/classes/class-twp-menus.php
r1356848 r1367419 295 295 foreach( $queues as $queue ) : 296 296 297 $wp_admin_bar->add_node( array( ' parent' => 'twp', 'title' => $queue->name, 'href' => admin_url( '/admin.php?page=twp_queues&queue=' . $queue->term_id ) ) );297 $wp_admin_bar->add_node( array( 'id' => 'twp_queue_' . $queue->name, 'parent' => 'twp', 'parent' => 'twp', 'title' => $queue->name, 'href' => admin_url( '/admin.php?page=twp_queues&queue=' . $queue->term_id ) ) ); 298 298 299 299 endforeach; … … 301 301 endif; 302 302 303 $wp_admin_bar->add_node( array( ' parent' => 'twp', 'title' => 'Add New Queue', 'href' => admin_url( '/admin.php?page=twp_queues&queue=0' ) ) );303 $wp_admin_bar->add_node( array( 'id' => 'twp_queue_new', 'parent' => 'twp', 'title' => 'Add New Queue', 'href' => admin_url( '/admin.php?page=twp_queues&queue=0' ) ) ); 304 304 305 305 } -
tweet-wheel/tags/1.0.3.2/includes/classes/class-twp-queues.php
r1356848 r1367419 168 168 } 169 169 170 // ...171 172 public static function create_default_queue() {173 174 $queues = TWP_Queues()->get_queues(true);175 176 if( $queues == false ) :177 178 $term = wp_insert_term(179 'Untitled Queue',180 'twp_queue'181 );182 183 TWP_Settings::restore_default_settings( $term['term_id'] );184 TWP_Schedule::restore_default_settings( $term['term_id'] );185 186 return true;187 188 endif;189 190 return false;191 192 }193 194 170 } 195 171 /** -
tweet-wheel/tags/1.0.3.2/includes/helpers.php
r1356848 r1367419 336 336 function twp_tweet_parse_excerpt( $post_id ) { 337 337 338 return html_entity_decode( get_the_excerpt($post_id),ENT_QUOTES,'UTF-8');338 return html_entity_decode(apply_filters('the_excerpt', get_post_field('post_excerpt', $post_id)),ENT_QUOTES,'UTF-8'); 339 339 340 340 } -
tweet-wheel/tags/1.0.3.2/includes/uninstall.php
r1356848 r1367419 19 19 20 20 global $wpdb; 21 22 //drop a custom db table (pre 2.0 compatibility)23 $wpdb->query( "DROP TABLE IF EXISTS " . $wpdb->prefix . "twp_queue" );24 $wpdb->query( "DROP TABLE IF EXISTS " . $wpdb->prefix . "twp_log" );25 $wpdb->query( "DROP TABLE IF EXISTS " . $wpdb->prefix . "twp_stats" );26 21 27 22 // Remove cron task … … 31 26 32 27 // Don't run anything below if user opted-in to leave settings 33 if( twp_get_option( 'twp_settings', 'keep_dat e' ) == 1 )28 if( twp_get_option( 'twp_settings', 'keep_data' ) == 1 ) 34 29 return false; 35 30 -
tweet-wheel/tags/1.0.3.2/readme.txt
r1358021 r1367419 4 4 Requires at least: 4.4 5 5 Tested up to: 4.4.2 6 Stable tag: 1.0.3. 16 Stable tag: 1.0.3.2 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 11 11 12 12 == Description == 13 14 TIME TO WRITE. YOUR BLOG NOTICED. MORE TRAFFIC.15 13 16 14 **Tweet Wheel** plugin helps you to share your WordPress posts, pages, products and any post type on Twitter automatically without your supervision. Promote your WordPress website on Twitter by tweeting regularly to earn more followers and drive more traffic. … … 92 90 == Changelog == 93 91 92 = 1.0.3.2 = 93 * Fixed a few bugs 94 * Revised the code 95 94 96 = 1.0.3.1 = 95 97 * Fixed a fatal error for new users upon the plugin activation -
tweet-wheel/tags/1.0.3.2/tweet-wheel.php
r1357267 r1367419 5 5 * Plugin URI: http://www.tweet-wheel.com 6 6 * Description: A powerful tool that keeps your Twitter profile active. Even when you are busy. 7 * Version: 1.0.3. 17 * Version: 1.0.3.2 8 8 * Author: Tomasz Lisiecki from Nerd Cow Ltd. 9 9 * Author URI: https://nerdcow.co.uk … … 32 32 * @var string 33 33 */ 34 public $version = '1.0.3. 1';34 public $version = '1.0.3.2'; 35 35 36 36 // ... … … 119 119 global $pagenow; 120 120 121 add_action( 'admin_init', array( $this, 'check_version' ) );122 123 if ( ! self::compatible_version() )124 return;125 126 // ...127 128 121 // Define all necessary constants 129 122 $this->constants(); … … 132 125 $this->includes(); 133 126 127 add_action( 'admin_init', 'twp_check_version' ); 128 129 if ( ! twp_compatible_version() ) 130 return; 131 132 // ... 133 134 134 // Hooks 135 add_action( 'admin_init', array( $this, 'redirect' ));135 add_action( 'admin_init', 'twp_redirect' ); 136 136 137 137 // Assets … … 234 234 235 235 // Fundamental settings 236 require_once( 'includes/helpers.php' ); 237 236 238 require_once( 'includes/classes/class-twp-menus.php' ); 237 239 require_once( 'includes/libraries/sf-settings.php' ); … … 279 281 280 282 require_once( 'includes/twp-metaboxes.php' ); 283 284 require_once( 'includes/install.php' ); 285 require_once( 'includes/uninstall.php' ); 281 286 282 287 if( defined( 'DOING_AJAX' ) ) : … … 888 893 889 894 /** 890 * Redirect after plugin activation (unless its a bulk update)891 *892 * @type function893 * @date 16/06/2015894 * @since 1.0895 *896 * @param N/A897 * @return N/A898 **/899 900 public function redirect() {901 if (get_option('twp_activation_redirect', false)) {902 delete_option('twp_activation_redirect');903 if(!isset($_GET['activate-multi']))904 {905 wp_redirect(admin_url('/'));906 }907 }908 }909 910 public function assign_caps() {911 912 $this->constants();913 914 // Make sure admin always have the capability915 $admin = get_role( 'administrator' );916 $admin->add_cap( TWP_USER_CAP );917 918 }919 920 // ...921 922 /**923 895 * Checks if user is allowed to use the plugin 924 896 * … … 1290 1262 1291 1263 public function admin_footer() {} 1292 1293 // ... 1294 1295 public static function activation_check() { 1296 if ( ! self::compatible_version() ) { 1297 deactivate_plugins( plugin_basename( __FILE__ ) ); 1298 wp_die( __( 'Tweet Wheel requires at least WordPress 4.4 and PHP 5.4!', TWP_TEXTDOMAIN ) ); 1299 } 1300 } 1301 1302 // ... 1303 1304 public function check_version() { 1305 1306 if ( ! self::compatible_version() ) { 1307 if ( is_plugin_active( plugin_basename( __FILE__ ) ) ) { 1308 deactivate_plugins( plugin_basename( __FILE__ ) ); 1309 add_action( 'admin_notices', array( $this, 'disabled_notice' ) ); 1310 if ( isset( $_GET['activate'] ) ) { 1311 unset( $_GET['activate'] ); 1312 } 1313 } 1314 } 1315 1316 } 1317 1318 // ... 1319 1320 public function disabled_notice() { 1321 1322 echo '<strong>' . esc_html__( 'Tweet Wheel requires WordPress 4.4 or higher and PHP 5.4 or higher!', TWP_TEXTDOMAIN ) . '</strong>'; 1323 1324 } 1325 1326 // ... 1327 1328 public static function compatible_version() { 1329 1330 global $wp_version; 1331 1332 if ( version_compare( $wp_version, '4.4', '<' ) ) { 1333 return false; 1334 } 1335 1336 if ( version_compare( PHP_VERSION, '5.4.0', '<' ) ) { 1337 return false; 1338 } 1339 1340 return true; 1341 } 1342 1264 1343 1265 } 1344 1266 … … 1354 1276 } 1355 1277 1356 require_once( 'includes/helpers.php' );1357 1358 1278 TWP()->init(); 1359 1279 1360 // Install 1361 require_once( 'includes/classes/class-twp-install.php' ); 1362 register_activation_hook( __FILE__, array( 'TWP_Install', 'install' ) ); 1363 1364 // Uninstall 1365 require_once( 'includes/uninstall.php' ); 1366 register_uninstall_hook( __FILE__, 'twp_uninstall' ); 1367 1368 // Activate 1369 register_activation_hook( __FILE__, array( TweetWheel::instance(), 'assign_caps' ) ); 1370 register_activation_hook( __FILE__, array( TweetWheel::instance(), 'activation_check' ) ); 1280 register_activation_hook( __FILE__, 'twp_install' ); 1281 register_activation_hook( __FILE__, 'twp_activation_check' ); 1282 register_activation_hook( __FILE__, 'twp_assign_caps' ); 1283 1284 register_uninstall_hook( __FILE__, 'twp_uninstall' );; 1371 1285 1372 1286 endif; -
tweet-wheel/trunk/includes/classes/class-twp-menus.php
r1356848 r1367419 295 295 foreach( $queues as $queue ) : 296 296 297 $wp_admin_bar->add_node( array( ' parent' => 'twp', 'title' => $queue->name, 'href' => admin_url( '/admin.php?page=twp_queues&queue=' . $queue->term_id ) ) );297 $wp_admin_bar->add_node( array( 'id' => 'twp_queue_' . $queue->name, 'parent' => 'twp', 'parent' => 'twp', 'title' => $queue->name, 'href' => admin_url( '/admin.php?page=twp_queues&queue=' . $queue->term_id ) ) ); 298 298 299 299 endforeach; … … 301 301 endif; 302 302 303 $wp_admin_bar->add_node( array( ' parent' => 'twp', 'title' => 'Add New Queue', 'href' => admin_url( '/admin.php?page=twp_queues&queue=0' ) ) );303 $wp_admin_bar->add_node( array( 'id' => 'twp_queue_new', 'parent' => 'twp', 'title' => 'Add New Queue', 'href' => admin_url( '/admin.php?page=twp_queues&queue=0' ) ) ); 304 304 305 305 } -
tweet-wheel/trunk/includes/classes/class-twp-queues.php
r1356848 r1367419 168 168 } 169 169 170 // ...171 172 public static function create_default_queue() {173 174 $queues = TWP_Queues()->get_queues(true);175 176 if( $queues == false ) :177 178 $term = wp_insert_term(179 'Untitled Queue',180 'twp_queue'181 );182 183 TWP_Settings::restore_default_settings( $term['term_id'] );184 TWP_Schedule::restore_default_settings( $term['term_id'] );185 186 return true;187 188 endif;189 190 return false;191 192 }193 194 170 } 195 171 /** -
tweet-wheel/trunk/includes/helpers.php
r1356848 r1367419 336 336 function twp_tweet_parse_excerpt( $post_id ) { 337 337 338 return html_entity_decode( get_the_excerpt($post_id),ENT_QUOTES,'UTF-8');338 return html_entity_decode(apply_filters('the_excerpt', get_post_field('post_excerpt', $post_id)),ENT_QUOTES,'UTF-8'); 339 339 340 340 } -
tweet-wheel/trunk/includes/uninstall.php
r1356848 r1367419 19 19 20 20 global $wpdb; 21 22 //drop a custom db table (pre 2.0 compatibility)23 $wpdb->query( "DROP TABLE IF EXISTS " . $wpdb->prefix . "twp_queue" );24 $wpdb->query( "DROP TABLE IF EXISTS " . $wpdb->prefix . "twp_log" );25 $wpdb->query( "DROP TABLE IF EXISTS " . $wpdb->prefix . "twp_stats" );26 21 27 22 // Remove cron task … … 31 26 32 27 // Don't run anything below if user opted-in to leave settings 33 if( twp_get_option( 'twp_settings', 'keep_dat e' ) == 1 )28 if( twp_get_option( 'twp_settings', 'keep_data' ) == 1 ) 34 29 return false; 35 30 -
tweet-wheel/trunk/readme.txt
r1358021 r1367419 4 4 Requires at least: 4.4 5 5 Tested up to: 4.4.2 6 Stable tag: 1.0.3. 16 Stable tag: 1.0.3.2 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 11 11 12 12 == Description == 13 14 TIME TO WRITE. YOUR BLOG NOTICED. MORE TRAFFIC.15 13 16 14 **Tweet Wheel** plugin helps you to share your WordPress posts, pages, products and any post type on Twitter automatically without your supervision. Promote your WordPress website on Twitter by tweeting regularly to earn more followers and drive more traffic. … … 92 90 == Changelog == 93 91 92 = 1.0.3.2 = 93 * Fixed a few bugs 94 * Revised the code 95 94 96 = 1.0.3.1 = 95 97 * Fixed a fatal error for new users upon the plugin activation -
tweet-wheel/trunk/tweet-wheel.php
r1357267 r1367419 5 5 * Plugin URI: http://www.tweet-wheel.com 6 6 * Description: A powerful tool that keeps your Twitter profile active. Even when you are busy. 7 * Version: 1.0.3. 17 * Version: 1.0.3.2 8 8 * Author: Tomasz Lisiecki from Nerd Cow Ltd. 9 9 * Author URI: https://nerdcow.co.uk … … 32 32 * @var string 33 33 */ 34 public $version = '1.0.3. 1';34 public $version = '1.0.3.2'; 35 35 36 36 // ... … … 119 119 global $pagenow; 120 120 121 add_action( 'admin_init', array( $this, 'check_version' ) );122 123 if ( ! self::compatible_version() )124 return;125 126 // ...127 128 121 // Define all necessary constants 129 122 $this->constants(); … … 132 125 $this->includes(); 133 126 127 add_action( 'admin_init', 'twp_check_version' ); 128 129 if ( ! twp_compatible_version() ) 130 return; 131 132 // ... 133 134 134 // Hooks 135 add_action( 'admin_init', array( $this, 'redirect' ));135 add_action( 'admin_init', 'twp_redirect' ); 136 136 137 137 // Assets … … 234 234 235 235 // Fundamental settings 236 require_once( 'includes/helpers.php' ); 237 236 238 require_once( 'includes/classes/class-twp-menus.php' ); 237 239 require_once( 'includes/libraries/sf-settings.php' ); … … 279 281 280 282 require_once( 'includes/twp-metaboxes.php' ); 283 284 require_once( 'includes/install.php' ); 285 require_once( 'includes/uninstall.php' ); 281 286 282 287 if( defined( 'DOING_AJAX' ) ) : … … 888 893 889 894 /** 890 * Redirect after plugin activation (unless its a bulk update)891 *892 * @type function893 * @date 16/06/2015894 * @since 1.0895 *896 * @param N/A897 * @return N/A898 **/899 900 public function redirect() {901 if (get_option('twp_activation_redirect', false)) {902 delete_option('twp_activation_redirect');903 if(!isset($_GET['activate-multi']))904 {905 wp_redirect(admin_url('/'));906 }907 }908 }909 910 public function assign_caps() {911 912 $this->constants();913 914 // Make sure admin always have the capability915 $admin = get_role( 'administrator' );916 $admin->add_cap( TWP_USER_CAP );917 918 }919 920 // ...921 922 /**923 895 * Checks if user is allowed to use the plugin 924 896 * … … 1290 1262 1291 1263 public function admin_footer() {} 1292 1293 // ... 1294 1295 public static function activation_check() { 1296 if ( ! self::compatible_version() ) { 1297 deactivate_plugins( plugin_basename( __FILE__ ) ); 1298 wp_die( __( 'Tweet Wheel requires at least WordPress 4.4 and PHP 5.4!', TWP_TEXTDOMAIN ) ); 1299 } 1300 } 1301 1302 // ... 1303 1304 public function check_version() { 1305 1306 if ( ! self::compatible_version() ) { 1307 if ( is_plugin_active( plugin_basename( __FILE__ ) ) ) { 1308 deactivate_plugins( plugin_basename( __FILE__ ) ); 1309 add_action( 'admin_notices', array( $this, 'disabled_notice' ) ); 1310 if ( isset( $_GET['activate'] ) ) { 1311 unset( $_GET['activate'] ); 1312 } 1313 } 1314 } 1315 1316 } 1317 1318 // ... 1319 1320 public function disabled_notice() { 1321 1322 echo '<strong>' . esc_html__( 'Tweet Wheel requires WordPress 4.4 or higher and PHP 5.4 or higher!', TWP_TEXTDOMAIN ) . '</strong>'; 1323 1324 } 1325 1326 // ... 1327 1328 public static function compatible_version() { 1329 1330 global $wp_version; 1331 1332 if ( version_compare( $wp_version, '4.4', '<' ) ) { 1333 return false; 1334 } 1335 1336 if ( version_compare( PHP_VERSION, '5.4.0', '<' ) ) { 1337 return false; 1338 } 1339 1340 return true; 1341 } 1342 1264 1343 1265 } 1344 1266 … … 1354 1276 } 1355 1277 1356 require_once( 'includes/helpers.php' );1357 1358 1278 TWP()->init(); 1359 1279 1360 // Install 1361 require_once( 'includes/classes/class-twp-install.php' ); 1362 register_activation_hook( __FILE__, array( 'TWP_Install', 'install' ) ); 1363 1364 // Uninstall 1365 require_once( 'includes/uninstall.php' ); 1366 register_uninstall_hook( __FILE__, 'twp_uninstall' ); 1367 1368 // Activate 1369 register_activation_hook( __FILE__, array( TweetWheel::instance(), 'assign_caps' ) ); 1370 register_activation_hook( __FILE__, array( TweetWheel::instance(), 'activation_check' ) ); 1280 register_activation_hook( __FILE__, 'twp_install' ); 1281 register_activation_hook( __FILE__, 'twp_activation_check' ); 1282 register_activation_hook( __FILE__, 'twp_assign_caps' ); 1283 1284 register_uninstall_hook( __FILE__, 'twp_uninstall' );; 1371 1285 1372 1286 endif;
Note: See TracChangeset
for help on using the changeset viewer.