Plugin Directory

Changeset 730022


Ignore:
Timestamp:
06/22/2013 04:02:30 PM (13 years ago)
Author:
atvdev
Message:

Wp functions namespaces fixed, version up

Location:
amazon-s3-uploads/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • amazon-s3-uploads/trunk/asssu.php

    r729295 r730022  
    66Author URI: https://profiles.google.com/117859515361389646005
    77Description: Moves your uploads to Amazon S3 via cron jobs.
    8 Version: 1.9.2
     8Version: 1.9.3
    99*/
    1010
  • amazon-s3-uploads/trunk/plugin/asssu/__init.php

    r729582 r730022  
    1414# upgrade
    1515# dokimi buckets se ola ta locations
     16# dokimi se server poy nomizei oti ta wp functions einai se relative namespace
    1617
    1718//////////////////////////////////////////////////////////////////////////////
     
    3132
    3233//////////////////////////////////////////////////////////////////////////////
    33 // pro
     34// extra
    3435# iam
    3536# cron time, file limit
     
    4243   
    4344    public static
    44         $version = '1.9.2';
     45        $version = '1.9.3';
    4546       
    4647    public
     
    6061        $this->options_integration = new AsssuOptionsIntegration($this);
    6162       
    62         $this->site_url = get_option('siteUrl');
     63        $this->site_url = \get_option('siteUrl');
    6364        $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();
    6566       
    6667        $this->db = new AsssuDb($this, $wpdb);
     
    113114    function upgrade_1_09() {
    114115        $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')
    125126        );
    126127        $this->db->wpdb->get_results('DROP TABLE `asssu_endpoints`', ARRAY_A);
    127128        foreach ($old_config as $k => $v)
    128             delete_option($k);
     129            \delete_option($k);
    129130
    130131        $this->db->create();
     
    137138           
    138139        $this->check_htaccess();
    139         return '1.9.1';
     140        return $this->config['version'];
    140141    }
    141142   
    142143    function upgrade_1_9_1() {
    143144        $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';
    144151        $this->db->save_config();
    145152        return $this->config['version'];
     
    172179                $this->db->save_config();
    173180                // 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.';
    177184                @ mail($recipient, $subject, $message);
    178185                throw new \Exception($message);
     
    209216   
    210217    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');
    213220    }
    214221}
     
    218225    function __construct($asssu) {
    219226        $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'));
    222229        # mporei na xriazetai na mpei sto form save mono
    223230        # 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');
    226233    }
    227234
     
    285292    function __construct($asssu) {
    286293        $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'));
    290297    }
    291298
     
    311318
    312319        // sanitize the file name before we begin processing
    313         $filename = sanitize_file_name($filename);
     320        $filename = \sanitize_file_name($filename);
    314321
    315322        // separate the filename into a name and extension
     
    363370    function __construct($asssu) {
    364371        $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'));
    367374    }
    368375
     
    382389    function __construct($asssu) {
    383390        $this->asssu = $asssu;
    384         add_action('admin_menu', array($this, 'action_admin_menu'));
     391        \add_action('admin_menu', array($this, 'action_admin_menu'));
    385392    }
    386393
    387394    function action_admin_menu() {
    388         add_plugins_page(
     395        \add_plugins_page(
    389396            'Amazon S3 Uploads',
    390397            'Amazon S3 Uploads',
     
    393400            array($this, 'page_options')
    394401        );
    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(
    397404                'Amazon S3 Uploads Test Corn',
    398405                'Amazon S3 Uploads Test Corn',
     
    401408                array($this, 'test_cron')
    402409            );
    403             add_plugins_page(
     410            \add_plugins_page(
    404411                'Amazon S3 Uploads Test Bucket Location',
    405412                'Amazon S3 Uploads Test Bucket Location',
     
    412419
    413420    function page_options() {
    414         if (!current_user_can('manage_options'))
     421        if (!\current_user_can('manage_options'))
    415422            die(__('Forbidden...'));
    416423       
     
    433440
    434441    function test_cron() {
    435         if (!current_user_can('manage_options'))
     442        if (!\current_user_can('manage_options'))
    436443            die(__('Forbidden...'));
    437         do_action('asssu_cron');
     444        \do_action('asssu_cron');
    438445    }
    439446
    440447    function test_bucket_location() {
    441         if (!current_user_can('manage_options'))
     448        if (!\current_user_can('manage_options'))
    442449            die(__('Forbidden...'));
    443450       
  • amazon-s3-uploads/trunk/readme.txt

    r729295 r730022  
    33Contributors: atvdev
    44Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7T88Q3EHGD9RS
    5 Requires at least: 3.5.1
    6 Tested up to: 3.5.1
    7 Stable tag: 1.9.2
     5Requires at least: 3.5.2
     6Tested up to: 3.5.2
     7Stable tag: 1.9.3
    88License: GPLv2.1
    99
Note: See TracChangeset for help on using the changeset viewer.