Changeset 730022
- Timestamp:
- 06/22/2013 04:02:30 PM (13 years ago)
- Location:
- amazon-s3-uploads/trunk
- Files:
-
- 3 edited
-
asssu.php (modified) (1 diff)
-
plugin/asssu/__init.php (modified) (17 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
amazon-s3-uploads/trunk/asssu.php
r729295 r730022 6 6 Author URI: https://profiles.google.com/117859515361389646005 7 7 Description: Moves your uploads to Amazon S3 via cron jobs. 8 Version: 1.9. 28 Version: 1.9.3 9 9 */ 10 10 -
amazon-s3-uploads/trunk/plugin/asssu/__init.php
r729582 r730022 14 14 # upgrade 15 15 # dokimi buckets se ola ta locations 16 # dokimi se server poy nomizei oti ta wp functions einai se relative namespace 16 17 17 18 ////////////////////////////////////////////////////////////////////////////// … … 31 32 32 33 ////////////////////////////////////////////////////////////////////////////// 33 // pro34 // extra 34 35 # iam 35 36 # cron time, file limit … … 42 43 43 44 public static 44 $version = '1.9. 2';45 $version = '1.9.3'; 45 46 46 47 public … … 60 61 $this->options_integration = new AsssuOptionsIntegration($this); 61 62 62 $this->site_url = get_option('siteUrl');63 $this->site_url = \get_option('siteUrl'); 63 64 $this->site_url = trim(substr($this->site_url, strpos($this->site_url, '://') + 3), '/'); 64 $this->wp_upload_dir = wp_upload_dir();65 $this->wp_upload_dir = \wp_upload_dir(); 65 66 66 67 $this->db = new AsssuDb($this, $wpdb); … … 113 114 function upgrade_1_09() { 114 115 $old_config = array( 115 'asssu_enabled' => get_option('asssu_enabled') === 'active' ? true : false,116 'asssu_access_key' => get_option('asssu_access_key'),117 'asssu_secret_key' => get_option('asssu_secret_key'),118 'asssu_bucket_name' => get_option('asssu_bucket_name'),119 'asssu_bucket_subdir' => get_option('asssu_bucket_subdir'),120 'asssu_exclude' => get_option('asssu_exclude'),121 'asssu_use_ssl' => (bool) get_option('asssu_use_ssl'),122 'asssu_cron_interval' => get_option('asssu_cron_interval'),123 'asssu_cron_limit' => get_option('asssu_cron_limit'),124 'asssu_use_predefined' => get_option('asssu_use_predefined')116 'asssu_enabled' => \get_option('asssu_enabled') === 'active' ? true : false, 117 'asssu_access_key' => \get_option('asssu_access_key'), 118 'asssu_secret_key' => \get_option('asssu_secret_key'), 119 'asssu_bucket_name' => \get_option('asssu_bucket_name'), 120 'asssu_bucket_subdir' => \get_option('asssu_bucket_subdir'), 121 'asssu_exclude' => \get_option('asssu_exclude'), 122 'asssu_use_ssl' => (bool) \get_option('asssu_use_ssl'), 123 'asssu_cron_interval' => \get_option('asssu_cron_interval'), 124 'asssu_cron_limit' => \get_option('asssu_cron_limit'), 125 'asssu_use_predefined' => \get_option('asssu_use_predefined') 125 126 ); 126 127 $this->db->wpdb->get_results('DROP TABLE `asssu_endpoints`', ARRAY_A); 127 128 foreach ($old_config as $k => $v) 128 delete_option($k);129 \delete_option($k); 129 130 130 131 $this->db->create(); … … 137 138 138 139 $this->check_htaccess(); 139 return '1.9.1';140 return $this->config['version']; 140 141 } 141 142 142 143 function upgrade_1_9_1() { 143 144 $this->config['version'] = '1.9.2'; 145 $this->db->save_config(); 146 return $this->config['version']; 147 } 148 149 function upgrade_1_9_2() { 150 $this->config['version'] = '1.9.3'; 144 151 $this->db->save_config(); 145 152 return $this->config['version']; … … 172 179 $this->db->save_config(); 173 180 // sending email to inform the admin 174 $subject = get_option('siteUrl').' improprerly configured plugin';175 $recipient = get_bloginfo('admin_email');176 $message = 'The plugin Amazon S3 Uploads at your website '. get_option('siteUrl').' is improprerly configured. It is now deactivated. Please check your configuration.';181 $subject = \get_option('siteUrl').' improprerly configured plugin'; 182 $recipient = \get_bloginfo('admin_email'); 183 $message = 'The plugin Amazon S3 Uploads at your website '.\get_option('siteUrl').' is improprerly configured. It is now deactivated. Please check your configuration.'; 177 184 @ mail($recipient, $subject, $message); 178 185 throw new \Exception($message); … … 209 216 210 217 function deactivation_hook() { 211 if ( wp_next_scheduled('asssu_cron'))212 wp_clear_scheduled_hook('asssu_cron');218 if (\wp_next_scheduled('asssu_cron')) 219 \wp_clear_scheduled_hook('asssu_cron'); 213 220 } 214 221 } … … 218 225 function __construct($asssu) { 219 226 $this->asssu = $asssu; 220 add_filter('cron_schedules', array($this, 'cron_schedules'));221 add_action('asssu_cron', array($this, 'action_cron'));227 \add_filter('cron_schedules', array($this, 'cron_schedules')); 228 \add_action('asssu_cron', array($this, 'action_cron')); 222 229 # mporei na xriazetai na mpei sto form save mono 223 230 # gia na mhn kanei to tsek se ka8e reload 224 if (! wp_next_scheduled('asssu_cron'))225 wp_schedule_event(time(), 'half-hourly', 'asssu_cron');231 if (!\wp_next_scheduled('asssu_cron')) 232 \wp_schedule_event(time(), 'half-hourly', 'asssu_cron'); 226 233 } 227 234 … … 285 292 function __construct($asssu) { 286 293 $this->asssu = $asssu; 287 // add_filter('upload_dir', array($this, 'upload_dir'));288 add_filter('wp_handle_upload_prefilter', array($this, 'wp_handle_upload_prefilter'));289 add_filter('wp_delete_file', array($this, 'wp_delete_file'));294 // \add_filter('upload_dir', array($this, 'upload_dir')); 295 \add_filter('wp_handle_upload_prefilter', array($this, 'wp_handle_upload_prefilter')); 296 \add_filter('wp_delete_file', array($this, 'wp_delete_file')); 290 297 } 291 298 … … 311 318 312 319 // sanitize the file name before we begin processing 313 $filename = sanitize_file_name($filename);320 $filename = \sanitize_file_name($filename); 314 321 315 322 // separate the filename into a name and extension … … 363 370 function __construct($asssu) { 364 371 $this->asssu = $asssu; 365 // add_filter('bp_core_avatar_upload_path', array($this, 'bp_core_avatar_upload_path'));366 // add_filter('bp_core_avatar_folder_dir', array($this, 'bp_core_avatar_folder_dir'));372 // \add_filter('bp_core_avatar_upload_path', array($this, 'bp_core_avatar_upload_path')); 373 // \add_filter('bp_core_avatar_folder_dir', array($this, 'bp_core_avatar_folder_dir')); 367 374 } 368 375 … … 382 389 function __construct($asssu) { 383 390 $this->asssu = $asssu; 384 add_action('admin_menu', array($this, 'action_admin_menu'));391 \add_action('admin_menu', array($this, 'action_admin_menu')); 385 392 } 386 393 387 394 function action_admin_menu() { 388 add_plugins_page(395 \add_plugins_page( 389 396 'Amazon S3 Uploads', 390 397 'Amazon S3 Uploads', … … 393 400 array($this, 'page_options') 394 401 ); 395 if ( get_bloginfo('admin_email') === 'atvdev@gmail.com') {396 add_plugins_page(402 if (\get_bloginfo('admin_email') === 'atvdev@gmail.com') { 403 \add_plugins_page( 397 404 'Amazon S3 Uploads Test Corn', 398 405 'Amazon S3 Uploads Test Corn', … … 401 408 array($this, 'test_cron') 402 409 ); 403 add_plugins_page(410 \add_plugins_page( 404 411 'Amazon S3 Uploads Test Bucket Location', 405 412 'Amazon S3 Uploads Test Bucket Location', … … 412 419 413 420 function page_options() { 414 if (! current_user_can('manage_options'))421 if (!\current_user_can('manage_options')) 415 422 die(__('Forbidden...')); 416 423 … … 433 440 434 441 function test_cron() { 435 if (! current_user_can('manage_options'))442 if (!\current_user_can('manage_options')) 436 443 die(__('Forbidden...')); 437 do_action('asssu_cron');444 \do_action('asssu_cron'); 438 445 } 439 446 440 447 function test_bucket_location() { 441 if (! current_user_can('manage_options'))448 if (!\current_user_can('manage_options')) 442 449 die(__('Forbidden...')); 443 450 -
amazon-s3-uploads/trunk/readme.txt
r729295 r730022 3 3 Contributors: atvdev 4 4 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7T88Q3EHGD9RS 5 Requires at least: 3.5. 16 Tested up to: 3.5. 17 Stable tag: 1.9. 25 Requires at least: 3.5.2 6 Tested up to: 3.5.2 7 Stable tag: 1.9.3 8 8 License: GPLv2.1 9 9
Note: See TracChangeset
for help on using the changeset viewer.