Plugin Directory

Changeset 3031216

Timestamp:
02/04/2024 07:38:55 PM (6 months ago)
Author:
khorshidlab
Message:

Plugin Version 1.3.0

Location:
arvancloud-object-storage
Files:
4 added
28 edited
1 copied

Legend:

Unmodified
Added
Removed
  • arvancloud-object-storage/tags/1.3.0/README.txt

    r2952379 r3031216  
    55Tested up to: 6.2
    66Requires PHP: 7.1
    7 Stable tag: 1.2.3
     7Stable tag: 1.
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    4848
    4949== Changelog ==
     50
     51
     52
     53
     54
    5055= 1.2.3 - 2023-08-11 =
    5156* fix: Check for thumbnails file existence
  • arvancloud-object-storage/tags/1.3.0/admin/partials/partial-set-api-key.php

    r2915892 r3031216  
    7777'secret-key' => '**************************************',
    7878'endpoint-url' => '*********************',
     79
    7980) ) );
    8081                    </textarea>
     
    125126
    126127                    </div>
     128
     129
     130
     131
     132
     133
     134
     135
    127136
    128137                    <p><?php echo __( "", 'arvancloud-object-storage' ) ?></p>
  • arvancloud-object-storage/tags/1.3.0/admin/partials/partial-settings-tab.php

    r2939988 r3031216  
    77    die;
    88}
     9
    910
    1011
     
    3839
    3940?>
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
    4053
     54
    4155<div class="obs-box-outline-title mb-4">
    4256    <?php _e( 'Settings', 'arvancloud-object-storage' ) ?>
     
    97111    <div class="obs-box-outline d-flex align-items-center justify-content-between">
    98112        <div>
     113
     114
     115
     116
     117
     118
     119
     120
     121
     122
     123
     124
     125
     126
     127
     128
     129
     130
     131
     132
     133
     134
     135
    99136            <div class="obs-box-outline-title"><?php _e( "Sync attachment deletion", 'arvancloud-object-storage' ) ?>
    100137            </div>
     
    121158</form>
    122159<br />
     160
     161
     162
     163
    123164
    124165
    125 
  • arvancloud-object-storage/tags/1.3.0/admin/partials/partial-settings.php

    r2871671 r3031216  
    7474        }
    7575        Partials::bucket_list()::footer()->die();
    76 
    7776    }
    78 
    79 
    8077    ?>
    8178</div>
  • arvancloud-object-storage/tags/1.3.0/inc/Admin/Admin.php

    r2952379 r3031216  
    8080
    8181        wp_enqueue_style( $this->plugin_name, ACS_PLUGIN_ROOT_URL . 'assets/css/main.css', array(), $this->version, 'all' );
    82 
     82        if(isset($_GET['page']) and $_GET['page'] == ACS_SLUG)
     83        wp_enqueue_style('tagify', ACS_PLUGIN_ROOT_URL . 'assets/css/tagify.css', array(), $this->version, 'all' );
     84       
    8385    }
    8486
     
    129131            wp_enqueue_script(  'clipboard' );
    130132        }
    131 
     133        if(isset($_GET['page']) and $_GET['page'] == ACS_SLUG)
     134        wp_enqueue_script('tagify', ACS_PLUGIN_ROOT_URL . 'assets/js/tagify.min.js', array( 'jquery' ), $this->version, false );
    132135    }
    133136
     
    254257                $access_key = sanitize_key( $_POST[ 'access-key' ] );
    255258                $secret_key = sanitize_key( $_POST[ 'secret-key' ] );
     259
    256260
    257261                $parsed_url = parse_url($_POST[ 'endpoint-url' ]);
     
    274278                    return;
    275279                }
     280
     281
     282
     283
     284
    276285
    277286                if( empty($endpoint_url) || !wp_http_validate_url($endpoint_url) )
     
    285294                $options[ 'secret-key' ]   = $secret_key;
    286295                $options[ 'endpoint-url' ] = wp_http_validate_url($endpoint_url);
     296
    287297
    288298                if ( ! empty( $_POST[ 'secret-key' ] ) && __( "-- not shown --", 'arvancloud-object-storage' ) === $_POST[ 'secret-key' ] ) {
     
    327337                $config = json_decode(ARVANCLOUD_STORAGE_SETTINGS, true);
    328338                $endpoint_url = $config['endpoint-url']??'';
     339
     340
     341
     342
     343
     344
    329345
    330346                if( empty($endpoint_url) || !wp_http_validate_url($endpoint_url) )
     
    409425      $settings = [
    410426                'keep-local-files' => isset( $_POST['keep-local-files'] ) ?: false,
    411                 'sync-attachment-deletion' => isset( $_POST['sync-attachment-deletion'] ) ?: false
     427                'sync-attachment-deletion' => isset( $_POST['sync-attachment-deletion'] ) ?: false,
     428                'file_ext'    => isset( $_POST['file_ext'] )    ?str_replace('\\','',$_POST['file_ext']): '',
     429                'file_f_size' => isset( $_POST['file_f_size'] ) ?$_POST['file_f_size']: '',
     430                'file_t_size' => isset( $_POST['file_t_size'] ) ?$_POST['file_t_size']: '',
    412431            ];
    413432
     
    441460    public function upload_media_to_storage( $post_id, $force_upload = false ) {
    442461
     462
    443463        $query_vars = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY);
    444 
    445464        $result = [];
    446465        parse_str($query_vars, $result);
     
    456475            return;
    457476        }
     477
     478
    458479
    459480        if( $force_upload || ( is_numeric( $post_id ) && !wp_attachment_is_image( $post_id ) ) ) {
     
    518539                    }
    519540                }
    520 
    521541                return true;
    522542            }
    523            
    524         }
    525 
     543        }
    526544    }
    527545
     
    548566
    549567        $upload_dir = wp_upload_dir();
     568
     569
    550570        $basename   = basename( $args['file'] );
    551571        $path       = str_replace( $basename, "", $args['file'] );
     
    553573        $post_id    = attachment_url_to_postid($url);
    554574        if(!file_exists($upload_dir['basedir'] . '/' . $args['file']))
    555             return;
     575            return $args;
     576
     577
    556578        $this->upload_media_to_storage( $upload_dir['basedir'] . '/' . $args['file'], true );
    557579        (S3Singletone::get_instance())->get_s3client()->putObjectTagging([
     
    576598                    if(!file_exists($file))
    577599                        return;
     600
     601
    578602                    $this->upload_media_to_storage( $file, true );
    579603
     
    857881            foreach ( $object_ids as $post_id ) {
    858882                sleep( 2 ); // Delay execution
    859                
     883                if(!self::check_valid_attachment($post_id))
     884                    return;
     885
    860886                if( wp_attachment_is_image( $post_id ) ) {
    861887                    $file = wp_get_attachment_metadata($post_id);
     
    13501376
    13511377        foreach ( $post_ids as $post_id ) {
     1378
     1379
     1380
    13521381            $file = wp_get_attachment_metadata($post_id);
    13531382
     
    16111640
    16121641        foreach ( $object_ids as $post_id ) {
     1642
     1643
    16131644            $one_percent++;
    16141645            $storage_file_url = get_post_meta( $post_id, 'acs_storage_file_url' );
     
    18361867        }
    18371868    }
     1869
     1870
     1871
     1872
     1873
     1874
     1875
     1876
     1877
     1878
     1879
     1880
     1881
     1882
     1883
     1884
     1885
     1886
     1887
     1888
     1889
     1890
    18381891}
  • arvancloud-object-storage/tags/1.3.0/inc/S3Singletone.php

    r2871671 r3031216  
    1717
    1818        $this->args = [
    19             'region'   => 'region',
     19            'region'   => 'region',
    2020            'version'  => '2006-03-01',
    2121            'endpoint' => $credentials['endpoint-url']??'https://s3.ir-thr-at1.arvanstorage.com',
  • arvancloud-object-storage/tags/1.3.0/inc/Storage.php

    r2915892 r3031216  
    127127        $plugin_admin = new Admin( $this->get_plugin_name(), $this->get_version() );
    128128
    129         $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
     129        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
    130130        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
    131131        $this->loader->add_action( 'admin_menu', $plugin_admin, 'setup_admin_menu' );
  • arvancloud-object-storage/tags/1.3.0/vendor/autoload.php

    r2952379 r3031216  
    2323require_once __DIR__ . '/composer/autoload_real.php';
    2424
    25 return ComposerAutoloaderInit53647cd09e77fef9105e230254b8d269::getLoader();
     25return ComposerAutoloaderInit::getLoader();
  • arvancloud-object-storage/tags/1.3.0/vendor/bin/jp.php

    r2930578 r3031216  
    113113        || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
    114114    ) {
    115         return include("phpvfscomposer://" . __DIR__ . '/..'.'/mtdowling/jmespath.php/bin/jp.php');
     115        include("phpvfscomposer://" . __DIR__ . '/..'.'/mtdowling/jmespath.php/bin/jp.php');
     116        exit(0);
    116117    }
    117118}
    118119
    119 return include __DIR__ . '/..'.'/mtdowling/jmespath.php/bin/jp.php';
     120include __DIR__ . '/..'.'/mtdowling/jmespath.php/bin/jp.php';
  • arvancloud-object-storage/tags/1.3.0/vendor/composer/ClassLoader.php

    r2930578 r3031216  
    4646    private static $includeFile;
    4747
    48     /** @var string|null */
     48    /** @var */
    4949    private $vendorDir;
    5050
    5151    // PSR-4
    5252    /**
    53      * @var array<string, array<string, int>>
     53     * @var array[]
     54     * @psalm-var array<string, array<string, int>>
    5455     */
    5556    private $prefixLengthsPsr4 = array();
    5657    /**
    57      * @var array<string, list<string>>
     58     * @var array[]
     59     * @psalm-var array<string, array<int, string>>
    5860     */
    5961    private $prefixDirsPsr4 = array();
    6062    /**
    61      * @var list<string>
     63     * @var array[]
     64     * @psalm-var array<string, string>
    6265     */
    6366    private $fallbackDirsPsr4 = array();
     
    6568    // PSR-0
    6669    /**
    67      * List of PSR-0 prefixes
    68      *
    69      * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
    70      *
    71      * @var array<string, array<string, list<string>>>
     70     * @var array[]
     71     * @psalm-var array<string, array<string, string[]>>
    7272     */
    7373    private $prefixesPsr0 = array();
    7474    /**
    75      * @var list<string>
     75     * @var array[]
     76     * @psalm-var array<string, string>
    7677     */
    7778    private $fallbackDirsPsr0 = array();
     
    8182
    8283    /**
    83      * @var array<string, string>
     84     * @var string[]
     85     * @psalm-var array<string, string>
    8486     */
    8587    private $classMap = array();
     
    8991
    9092    /**
    91      * @var array<string, bool>
     93     * @var bool[]
     94     * @psalm-var array<string, bool>
    9295     */
    9396    private $missingClasses = array();
    9497
    95     /** @var string|null */
     98    /** @var */
    9699    private $apcuPrefix;
    97100
    98101    /**
    99      * @var array<string, self>
     102     * @var
    100103     */
    101104    private static $registeredLoaders = array();
    102105
    103106    /**
    104      * @param string|null $vendorDir
     107     * @param $vendorDir
    105108     */
    106109    public function __construct($vendorDir = null)
     
    111114
    112115    /**
    113      * @return array<string, list<string>>
     116     * @return
    114117     */
    115118    public function getPrefixes()
     
    123126
    124127    /**
    125      * @return array<string, list<string>>
     128     * @return array[]
     129     * @psalm-return array<string, array<int, string>>
    126130     */
    127131    public function getPrefixesPsr4()
     
    131135
    132136    /**
    133      * @return list<string>
     137     * @return array[]
     138     * @psalm-return array<string, string>
    134139     */
    135140    public function getFallbackDirs()
     
    139144
    140145    /**
    141      * @return list<string>
     146     * @return array[]
     147     * @psalm-return array<string, string>
    142148     */
    143149    public function getFallbackDirsPsr4()
     
    147153
    148154    /**
    149      * @return array<string, string> Array of classname => path
     155     * @return string[] Array of classname => path
     156     * @psalm-return array<string, string>
    150157     */
    151158    public function getClassMap()
     
    155162
    156163    /**
    157      * @param array<string, string> $classMap Class to filename map
     164     * @param string[] $classMap Class to filename map
     165     * @psalm-param array<string, string> $classMap
    158166     *
    159167     * @return void
     
    172180     * appending or prepending to the ones previously set for this prefix.
    173181     *
    174      * @param string              $prefix  The prefix
    175      * @param list<string>|string $paths   The PSR-0 root directories
    176      * @param bool                $prepend Whether to prepend the directories
     182     * @param string          $prefix  The prefix
     183     * @param |string $paths   The PSR-0 root directories
     184     * @param bool            $prepend Whether to prepend the directories
    177185     *
    178186     * @return void
     
    180188    public function add($prefix, $paths, $prepend = false)
    181189    {
    182         $paths = (array) $paths;
    183190        if (!$prefix) {
    184191            if ($prepend) {
    185192                $this->fallbackDirsPsr0 = array_merge(
    186                     $paths,
     193                    $paths,
    187194                    $this->fallbackDirsPsr0
    188195                );
     
    190197                $this->fallbackDirsPsr0 = array_merge(
    191198                    $this->fallbackDirsPsr0,
    192                     $paths
     199                    $paths
    193200                );
    194201            }
     
    199206        $first = $prefix[0];
    200207        if (!isset($this->prefixesPsr0[$first][$prefix])) {
    201             $this->prefixesPsr0[$first][$prefix] = $paths;
     208            $this->prefixesPsr0[$first][$prefix] = $paths;
    202209
    203210            return;
     
    205212        if ($prepend) {
    206213            $this->prefixesPsr0[$first][$prefix] = array_merge(
    207                 $paths,
     214                $paths,
    208215                $this->prefixesPsr0[$first][$prefix]
    209216            );
     
    211218            $this->prefixesPsr0[$first][$prefix] = array_merge(
    212219                $this->prefixesPsr0[$first][$prefix],
    213                 $paths
     220                $paths
    214221            );
    215222        }
     
    220227     * appending or prepending to the ones previously set for this namespace.
    221228     *
    222      * @param string              $prefix  The prefix/namespace, with trailing '\\'
    223      * @param list<string>|string $paths   The PSR-4 base directories
    224      * @param bool                $prepend Whether to prepend the directories
     229     * @param string          $prefix  The prefix/namespace, with trailing '\\'
     230     * @param |string $paths   The PSR-4 base directories
     231     * @param bool            $prepend Whether to prepend the directories
    225232     *
    226233     * @throws \InvalidArgumentException
     
    230237    public function addPsr4($prefix, $paths, $prepend = false)
    231238    {
    232         $paths = (array) $paths;
    233239        if (!$prefix) {
    234240            // Register directories for the root namespace.
    235241            if ($prepend) {
    236242                $this->fallbackDirsPsr4 = array_merge(
    237                     $paths,
     243                    $paths,
    238244                    $this->fallbackDirsPsr4
    239245                );
     
    241247                $this->fallbackDirsPsr4 = array_merge(
    242248                    $this->fallbackDirsPsr4,
    243                     $paths
     249                    $paths
    244250                );
    245251            }
     
    251257            }
    252258            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
    253             $this->prefixDirsPsr4[$prefix] = $paths;
     259            $this->prefixDirsPsr4[$prefix] = $paths;
    254260        } elseif ($prepend) {
    255261            // Prepend directories for an already registered namespace.
    256262            $this->prefixDirsPsr4[$prefix] = array_merge(
    257                 $paths,
     263                $paths,
    258264                $this->prefixDirsPsr4[$prefix]
    259265            );
     
    262268            $this->prefixDirsPsr4[$prefix] = array_merge(
    263269                $this->prefixDirsPsr4[$prefix],
    264                 $paths
     270                $paths
    265271            );
    266272        }
     
    271277     * replacing any others previously set for this prefix.
    272278     *
    273      * @param string              $prefix The prefix
    274      * @param list<string>|string $paths  The PSR-0 base directories
     279     * @param string          $prefix The prefix
     280     * @param |string $paths  The PSR-0 base directories
    275281     *
    276282     * @return void
     
    289295     * replacing any others previously set for this namespace.
    290296     *
    291      * @param string              $prefix The prefix/namespace, with trailing '\\'
    292      * @param list<string>|string $paths  The PSR-4 base directories
     297     * @param string          $prefix The prefix/namespace, with trailing '\\'
     298     * @param |string $paths  The PSR-4 base directories
    293299     *
    294300     * @throws \InvalidArgumentException
     
    476482
    477483    /**
    478      * Returns the currently registered loaders keyed by their corresponding vendor directories.
    479      *
    480      * @return array<string, self>
     484     * Returns the currently registered loaders ed by their corresponding vendor directories.
     485     *
     486     * @return
    481487     */
    482488    public static function getRegisteredLoaders()
  • arvancloud-object-storage/tags/1.3.0/vendor/composer/autoload_real.php

    r2952379 r3031216  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit53647cd09e77fef9105e230254b8d269
     5class ComposerAutoloaderInit
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit53647cd09e77fef9105e230254b8d269', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit53647cd09e77fef9105e230254b8d269', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInit53647cd09e77fef9105e230254b8d269::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInit::getInitializer($loader));
    3333
    3434        $loader->register(true);
    3535
    36         $filesToLoad = \Composer\Autoload\ComposerStaticInit53647cd09e77fef9105e230254b8d269::$files;
     36        $filesToLoad = \Composer\Autoload\ComposerStaticInit::$files;
    3737        $requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
    3838            if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
  • arvancloud-object-storage/tags/1.3.0/vendor/composer/autoload_static.php

    r2952379 r3031216  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit53647cd09e77fef9105e230254b8d269
     7class ComposerStaticInit
    88{
    99    public static $files = array (
     
    11611161    {
    11621162        return \Closure::bind(function () use ($loader) {
    1163             $loader->prefixLengthsPsr4 = ComposerStaticInit53647cd09e77fef9105e230254b8d269::$prefixLengthsPsr4;
    1164             $loader->prefixDirsPsr4 = ComposerStaticInit53647cd09e77fef9105e230254b8d269::$prefixDirsPsr4;
    1165             $loader->classMap = ComposerStaticInit53647cd09e77fef9105e230254b8d269::$classMap;
     1163            $loader->prefixLengthsPsr4 = ComposerStaticInit::$prefixLengthsPsr4;
     1164            $loader->prefixDirsPsr4 = ComposerStaticInit::$prefixDirsPsr4;
     1165            $loader->classMap = ComposerStaticInit::$classMap;
    11661166
    11671167        }, null, ClassLoader::class);
  • arvancloud-object-storage/tags/1.3.0/vendor/composer/installed.php

    r2952379 r3031216  
    44        'pretty_version' => 'dev-master',
    55        'version' => 'dev-master',
    6         'reference' => 'dee4894fd789e60f5693a74312fdbdd3ded7e4bd',
     6        'reference' => '',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    5959            'pretty_version' => 'dev-master',
    6060            'version' => 'dev-master',
    61             'reference' => 'dee4894fd789e60f5693a74312fdbdd3ded7e4bd',
     61            'reference' => '',
    6262            'type' => 'library',
    6363            'install_path' => __DIR__ . '/../../',
  • arvancloud-object-storage/tags/1.3.0/wp-arvancloud-storage.php

    r2952379 r3031216  
    1010 * Plugin URI:        https://www.arvancloud.com/fa/products/cloud-storage
    1111 * Description:       Using ArvanCloud Storage Plugin you can offload, back up and upload your WordPress files and databases directly to your ArvanCloud object storage bucket. This easy-to-use plugin allows you to back up, restore and store your files simply and securely to a cost-effective, unlimited cloud storage. No need for expensive hosting services anymore.
    12  * Version:           1.2.3
     12 * Version:           1.
    1313 * Author:            Khorshid, ArvanCloud
    1414 * Author URI:        https://www.arvancloud.com/en/products/cloud-storage
     
    2828}
    2929
    30 define( 'ACS_VERSION', '1.2.3' );
     30define( 'ACS_VERSION', '1.' );
    3131define( 'ACS_NAME', __( 'ArvanCloud Storage', 'arvancloud-object-storage' ) );
    3232define( 'ACS_SLUG', 'wp-arvancloud-storage');
  • arvancloud-object-storage/trunk/README.txt

    r2952379 r3031216  
    55Tested up to: 6.2
    66Requires PHP: 7.1
    7 Stable tag: 1.2.3
     7Stable tag: 1.
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    4848
    4949== Changelog ==
     50
     51
     52
     53
     54
    5055= 1.2.3 - 2023-08-11 =
    5156* fix: Check for thumbnails file existence
  • arvancloud-object-storage/trunk/admin/partials/partial-set-api-key.php

    r2915892 r3031216  
    7777'secret-key' =&gt; '**************************************',
    7878'endpoint-url' =&gt; '*********************',
     79
    7980) ) );
    8081                    </textarea>
     
    125126
    126127                    </div>
     128
     129
     130
     131
     132
     133
     134
     135
    127136
    128137                    <p><?php echo __( "", 'arvancloud-object-storage' ) ?></p>
  • arvancloud-object-storage/trunk/admin/partials/partial-settings-tab.php

    r2939988 r3031216  
    77    die;
    88}
     9
    910
    1011
     
    3839
    3940?>
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
    4053
     54
    4155<div class="obs-box-outline-title mb-4">
    4256    <?php _e( 'Settings', 'arvancloud-object-storage' ) ?>
     
    97111    <div class="obs-box-outline d-flex align-items-center justify-content-between">
    98112        <div>
     113
     114
     115
     116
     117
     118
     119
     120
     121
     122
     123
     124
     125
     126
     127
     128
     129
     130
     131
     132
     133
     134
     135
    99136            <div class="obs-box-outline-title"><?php _e( "Sync attachment deletion", 'arvancloud-object-storage' ) ?>
    100137            </div>
     
    121158</form>
    122159<br />
     160
     161
     162
     163
    123164
    124165
    125 
  • arvancloud-object-storage/trunk/admin/partials/partial-settings.php

    r2871671 r3031216  
    7474        }
    7575        Partials::bucket_list()::footer()->die();
    76 
    7776    }
    78 
    79 
    8077    ?>
    8178</div>
  • arvancloud-object-storage/trunk/inc/Admin/Admin.php

    r2952379 r3031216  
    8080
    8181        wp_enqueue_style( $this->plugin_name, ACS_PLUGIN_ROOT_URL . 'assets/css/main.css', array(), $this->version, 'all' );
    82 
     82        if(isset($_GET['page']) and $_GET['page'] == ACS_SLUG)
     83        wp_enqueue_style('tagify', ACS_PLUGIN_ROOT_URL . 'assets/css/tagify.css', array(), $this->version, 'all' );
     84       
    8385    }
    8486
     
    129131            wp_enqueue_script(  'clipboard' );
    130132        }
    131 
     133        if(isset($_GET['page']) and $_GET['page'] == ACS_SLUG)
     134        wp_enqueue_script('tagify', ACS_PLUGIN_ROOT_URL . 'assets/js/tagify.min.js', array( 'jquery' ), $this->version, false );
    132135    }
    133136
     
    254257                $access_key = sanitize_key( $_POST[ 'access-key' ] );
    255258                $secret_key = sanitize_key( $_POST[ 'secret-key' ] );
     259
    256260
    257261                $parsed_url = parse_url($_POST[ 'endpoint-url' ]);
     
    274278                    return;
    275279                }
     280
     281
     282
     283
     284
    276285
    277286                if( empty($endpoint_url) || !wp_http_validate_url($endpoint_url) )
     
    285294                $options[ 'secret-key' ]   = $secret_key;
    286295                $options[ 'endpoint-url' ] = wp_http_validate_url($endpoint_url);
     296
    287297
    288298                if ( ! empty( $_POST[ 'secret-key' ] ) && __( "-- not shown --", 'arvancloud-object-storage' ) === $_POST[ 'secret-key' ] ) {
     
    327337                $config = json_decode(ARVANCLOUD_STORAGE_SETTINGS, true);
    328338                $endpoint_url = $config['endpoint-url']??'';
     339
     340
     341
     342
     343
     344
    329345
    330346                if( empty($endpoint_url) || !wp_http_validate_url($endpoint_url) )
     
    409425      $settings = [
    410426                'keep-local-files' => isset( $_POST['keep-local-files'] ) ?: false,
    411                 'sync-attachment-deletion' => isset( $_POST['sync-attachment-deletion'] ) ?: false
     427                'sync-attachment-deletion' => isset( $_POST['sync-attachment-deletion'] ) ?: false,
     428                'file_ext'    => isset( $_POST['file_ext'] )    ?str_replace('\\','',$_POST['file_ext']): '',
     429                'file_f_size' => isset( $_POST['file_f_size'] ) ?$_POST['file_f_size']: '',
     430                'file_t_size' => isset( $_POST['file_t_size'] ) ?$_POST['file_t_size']: '',
    412431            ];
    413432
     
    441460    public function upload_media_to_storage( $post_id, $force_upload = false ) {
    442461
     462
    443463        $query_vars = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY);
    444 
    445464        $result = [];
    446465        parse_str($query_vars, $result);
     
    456475            return;
    457476        }
     477
     478
    458479
    459480        if( $force_upload || ( is_numeric( $post_id ) && !wp_attachment_is_image( $post_id ) ) ) {
     
    518539                    }
    519540                }
    520 
    521541                return true;
    522542            }
    523            
    524         }
    525 
     543        }
    526544    }
    527545
     
    548566
    549567        $upload_dir = wp_upload_dir();
     568
     569
    550570        $basename   = basename( $args['file'] );
    551571        $path       = str_replace( $basename, "", $args['file'] );
     
    553573        $post_id    = attachment_url_to_postid($url);
    554574        if(!file_exists($upload_dir['basedir'] . '/' . $args['file']))
    555             return;
     575            return $args;
     576
     577
    556578        $this->upload_media_to_storage( $upload_dir['basedir'] . '/' . $args['file'], true );
    557579        (S3Singletone::get_instance())->get_s3client()->putObjectTagging([
     
    576598                    if(!file_exists($file))
    577599                        return;
     600
     601
    578602                    $this->upload_media_to_storage( $file, true );
    579603
     
    857881            foreach ( $object_ids as $post_id ) {
    858882                sleep( 2 ); // Delay execution
    859                
     883                if(!self::check_valid_attachment($post_id))
     884                    return;
     885
    860886                if( wp_attachment_is_image( $post_id ) ) {
    861887                    $file = wp_get_attachment_metadata($post_id);
     
    13501376
    13511377        foreach ( $post_ids as $post_id ) {
     1378
     1379
     1380
    13521381            $file = wp_get_attachment_metadata($post_id);
    13531382
     
    16111640
    16121641        foreach ( $object_ids as $post_id ) {
     1642
     1643
    16131644            $one_percent++;
    16141645            $storage_file_url = get_post_meta( $post_id, 'acs_storage_file_url' );
     
    18361867        }
    18371868    }
     1869
     1870
     1871
     1872
     1873
     1874
     1875
     1876
     1877
     1878
     1879
     1880
     1881
     1882
     1883
     1884
     1885
     1886
     1887
     1888
     1889
     1890
    18381891}
  • arvancloud-object-storage/trunk/inc/S3Singletone.php

    r2871671 r3031216  
    1717
    1818        $this->args = [
    19             'region'   => 'region',
     19            'region'   => 'region',
    2020            'version'  => '2006-03-01',
    2121            'endpoint' => $credentials['endpoint-url']??'https://s3.ir-thr-at1.arvanstorage.com',
  • arvancloud-object-storage/trunk/inc/Storage.php

    r2915892 r3031216  
    127127        $plugin_admin = new Admin( $this->get_plugin_name(), $this->get_version() );
    128128
    129         $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
     129        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
    130130        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
    131131        $this->loader->add_action( 'admin_menu', $plugin_admin, 'setup_admin_menu' );
  • arvancloud-object-storage/trunk/vendor/autoload.php

    r2952379 r3031216  
    2323require_once __DIR__ . '/composer/autoload_real.php';
    2424
    25 return ComposerAutoloaderInit53647cd09e77fef9105e230254b8d269::getLoader();
     25return ComposerAutoloaderInit::getLoader();
  • arvancloud-object-storage/trunk/vendor/bin/jp.php

    r2930578 r3031216  
    113113        || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
    114114    ) {
    115         return include("phpvfscomposer://" . __DIR__ . '/..'.'/mtdowling/jmespath.php/bin/jp.php');
     115        include("phpvfscomposer://" . __DIR__ . '/..'.'/mtdowling/jmespath.php/bin/jp.php');
     116        exit(0);
    116117    }
    117118}
    118119
    119 return include __DIR__ . '/..'.'/mtdowling/jmespath.php/bin/jp.php';
     120include __DIR__ . '/..'.'/mtdowling/jmespath.php/bin/jp.php';
  • arvancloud-object-storage/trunk/vendor/composer/ClassLoader.php

    r2930578 r3031216  
    4646    private static $includeFile;
    4747
    48     /** @var string|null */
     48    /** @var */
    4949    private $vendorDir;
    5050
    5151    // PSR-4
    5252    /**
    53      * @var array<string, array<string, int>>
     53     * @var array[]
     54     * @psalm-var array<string, array<string, int>>
    5455     */
    5556    private $prefixLengthsPsr4 = array();
    5657    /**
    57      * @var array<string, list<string>>
     58     * @var array[]
     59     * @psalm-var array<string, array<int, string>>
    5860     */
    5961    private $prefixDirsPsr4 = array();
    6062    /**
    61      * @var list<string>
     63     * @var array[]
     64     * @psalm-var array<string, string>
    6265     */
    6366    private $fallbackDirsPsr4 = array();
     
    6568    // PSR-0
    6669    /**
    67      * List of PSR-0 prefixes
    68      *
    69      * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
    70      *
    71      * @var array<string, array<string, list<string>>>
     70     * @var array[]
     71     * @psalm-var array<string, array<string, string[]>>
    7272     */
    7373    private $prefixesPsr0 = array();
    7474    /**
    75      * @var list<string>
     75     * @var array[]
     76     * @psalm-var array<string, string>
    7677     */
    7778    private $fallbackDirsPsr0 = array();
     
    8182
    8283    /**
    83      * @var array<string, string>
     84     * @var string[]
     85     * @psalm-var array<string, string>
    8486     */
    8587    private $classMap = array();
     
    8991
    9092    /**
    91      * @var array<string, bool>
     93     * @var bool[]
     94     * @psalm-var array<string, bool>
    9295     */
    9396    private $missingClasses = array();
    9497
    95     /** @var string|null */
     98    /** @var */
    9699    private $apcuPrefix;
    97100
    98101    /**
    99      * @var array<string, self>
     102     * @var
    100103     */
    101104    private static $registeredLoaders = array();
    102105
    103106    /**
    104      * @param string|null $vendorDir
     107     * @param $vendorDir
    105108     */
    106109    public function __construct($vendorDir = null)
     
    111114
    112115    /**
    113      * @return array<string, list<string>>
     116     * @return
    114117     */
    115118    public function getPrefixes()
     
    123126
    124127    /**
    125      * @return array<string, list<string>>
     128     * @return array[]
     129     * @psalm-return array<string, array<int, string>>
    126130     */
    127131    public function getPrefixesPsr4()
     
    131135
    132136    /**
    133      * @return list<string>
     137     * @return array[]
     138     * @psalm-return array<string, string>
    134139     */
    135140    public function getFallbackDirs()
     
    139144
    140145    /**
    141      * @return list<string>
     146     * @return array[]
     147     * @psalm-return array<string, string>
    142148     */
    143149    public function getFallbackDirsPsr4()
     
    147153
    148154    /**
    149      * @return array<string, string> Array of classname => path
     155     * @return string[] Array of classname => path
     156     * @psalm-return array<string, string>
    150157     */
    151158    public function getClassMap()
     
    155162
    156163    /**
    157      * @param array<string, string> $classMap Class to filename map
     164     * @param string[] $classMap Class to filename map
     165     * @psalm-param array<string, string> $classMap
    158166     *
    159167     * @return void
     
    172180     * appending or prepending to the ones previously set for this prefix.
    173181     *
    174      * @param string              $prefix  The prefix
    175      * @param list<string>|string $paths   The PSR-0 root directories
    176      * @param bool                $prepend Whether to prepend the directories
     182     * @param string          $prefix  The prefix
     183     * @param |string $paths   The PSR-0 root directories
     184     * @param bool            $prepend Whether to prepend the directories
    177185     *
    178186     * @return void
     
    180188    public function add($prefix, $paths, $prepend = false)
    181189    {
    182         $paths = (array) $paths;
    183190        if (!$prefix) {
    184191            if ($prepend) {
    185192                $this->fallbackDirsPsr0 = array_merge(
    186                     $paths,
     193                    $paths,
    187194                    $this->fallbackDirsPsr0
    188195                );
     
    190197                $this->fallbackDirsPsr0 = array_merge(
    191198                    $this->fallbackDirsPsr0,
    192                     $paths
     199                    $paths
    193200                );
    194201            }
     
    199206        $first = $prefix[0];
    200207        if (!isset($this->prefixesPsr0[$first][$prefix])) {
    201             $this->prefixesPsr0[$first][$prefix] = $paths;
     208            $this->prefixesPsr0[$first][$prefix] = $paths;
    202209
    203210            return;
     
    205212        if ($prepend) {
    206213            $this->prefixesPsr0[$first][$prefix] = array_merge(
    207                 $paths,
     214                $paths,
    208215                $this->prefixesPsr0[$first][$prefix]
    209216            );
     
    211218            $this->prefixesPsr0[$first][$prefix] = array_merge(
    212219                $this->prefixesPsr0[$first][$prefix],
    213                 $paths
     220                $paths
    214221            );
    215222        }
     
    220227     * appending or prepending to the ones previously set for this namespace.
    221228     *
    222      * @param string              $prefix  The prefix/namespace, with trailing '\\'
    223      * @param list<string>|string $paths   The PSR-4 base directories
    224      * @param bool                $prepend Whether to prepend the directories
     229     * @param string          $prefix  The prefix/namespace, with trailing '\\'
     230     * @param |string $paths   The PSR-4 base directories
     231     * @param bool            $prepend Whether to prepend the directories
    225232     *
    226233     * @throws \InvalidArgumentException
     
    230237    public function addPsr4($prefix, $paths, $prepend = false)
    231238    {
    232         $paths = (array) $paths;
    233239        if (!$prefix) {
    234240            // Register directories for the root namespace.
    235241            if ($prepend) {
    236242                $this->fallbackDirsPsr4 = array_merge(
    237                     $paths,
     243                    $paths,
    238244                    $this->fallbackDirsPsr4
    239245                );
     
    241247                $this->fallbackDirsPsr4 = array_merge(
    242248                    $this->fallbackDirsPsr4,
    243                     $paths
     249                    $paths
    244250                );
    245251            }
     
    251257            }
    252258            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
    253             $this->prefixDirsPsr4[$prefix] = $paths;
     259            $this->prefixDirsPsr4[$prefix] = $paths;
    254260        } elseif ($prepend) {
    255261            // Prepend directories for an already registered namespace.
    256262            $this->prefixDirsPsr4[$prefix] = array_merge(
    257                 $paths,
     263                $paths,
    258264                $this->prefixDirsPsr4[$prefix]
    259265            );
     
    262268            $this->prefixDirsPsr4[$prefix] = array_merge(
    263269                $this->prefixDirsPsr4[$prefix],
    264                 $paths
     270                $paths
    265271            );
    266272        }
     
    271277     * replacing any others previously set for this prefix.
    272278     *
    273      * @param string              $prefix The prefix
    274      * @param list<string>|string $paths  The PSR-0 base directories
     279     * @param string          $prefix The prefix
     280     * @param |string $paths  The PSR-0 base directories
    275281     *
    276282     * @return void
     
    289295     * replacing any others previously set for this namespace.
    290296     *
    291      * @param string              $prefix The prefix/namespace, with trailing '\\'
    292      * @param list<string>|string $paths  The PSR-4 base directories
     297     * @param string          $prefix The prefix/namespace, with trailing '\\'
     298     * @param |string $paths  The PSR-4 base directories
    293299     *
    294300     * @throws \InvalidArgumentException
     
    476482
    477483    /**
    478      * Returns the currently registered loaders keyed by their corresponding vendor directories.
    479      *
    480      * @return array<string, self>
     484     * Returns the currently registered loaders ed by their corresponding vendor directories.
     485     *
     486     * @return
    481487     */
    482488    public static function getRegisteredLoaders()
  • arvancloud-object-storage/trunk/vendor/composer/autoload_real.php

    r2952379 r3031216  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit53647cd09e77fef9105e230254b8d269
     5class ComposerAutoloaderInit
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit53647cd09e77fef9105e230254b8d269', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit53647cd09e77fef9105e230254b8d269', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInit53647cd09e77fef9105e230254b8d269::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInit::getInitializer($loader));
    3333
    3434        $loader->register(true);
    3535
    36         $filesToLoad = \Composer\Autoload\ComposerStaticInit53647cd09e77fef9105e230254b8d269::$files;
     36        $filesToLoad = \Composer\Autoload\ComposerStaticInit::$files;
    3737        $requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
    3838            if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
  • arvancloud-object-storage/trunk/vendor/composer/autoload_static.php

    r2952379 r3031216  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit53647cd09e77fef9105e230254b8d269
     7class ComposerStaticInit
    88{
    99    public static $files = array (
     
    11611161    {
    11621162        return \Closure::bind(function () use ($loader) {
    1163             $loader->prefixLengthsPsr4 = ComposerStaticInit53647cd09e77fef9105e230254b8d269::$prefixLengthsPsr4;
    1164             $loader->prefixDirsPsr4 = ComposerStaticInit53647cd09e77fef9105e230254b8d269::$prefixDirsPsr4;
    1165             $loader->classMap = ComposerStaticInit53647cd09e77fef9105e230254b8d269::$classMap;
     1163            $loader->prefixLengthsPsr4 = ComposerStaticInit::$prefixLengthsPsr4;
     1164            $loader->prefixDirsPsr4 = ComposerStaticInit::$prefixDirsPsr4;
     1165            $loader->classMap = ComposerStaticInit::$classMap;
    11661166
    11671167        }, null, ClassLoader::class);
  • arvancloud-object-storage/trunk/vendor/composer/installed.php

    r2952379 r3031216  
    44        'pretty_version' => 'dev-master',
    55        'version' => 'dev-master',
    6         'reference' => 'dee4894fd789e60f5693a74312fdbdd3ded7e4bd',
     6        'reference' => '',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    5959            'pretty_version' => 'dev-master',
    6060            'version' => 'dev-master',
    61             'reference' => 'dee4894fd789e60f5693a74312fdbdd3ded7e4bd',
     61            'reference' => '',
    6262            'type' => 'library',
    6363            'install_path' => __DIR__ . '/../../',
  • arvancloud-object-storage/trunk/wp-arvancloud-storage.php

    r2952379 r3031216  
    1010 * Plugin URI:        https://www.arvancloud.com/fa/products/cloud-storage
    1111 * Description:       Using ArvanCloud Storage Plugin you can offload, back up and upload your WordPress files and databases directly to your ArvanCloud object storage bucket. This easy-to-use plugin allows you to back up, restore and store your files simply and securely to a cost-effective, unlimited cloud storage. No need for expensive hosting services anymore.
    12  * Version:           1.2.3
     12 * Version:           1.
    1313 * Author:            Khorshid, ArvanCloud
    1414 * Author URI:        https://www.arvancloud.com/en/products/cloud-storage
     
    2828}
    2929
    30 define( 'ACS_VERSION', '1.2.3' );
     30define( 'ACS_VERSION', '1.' );
    3131define( 'ACS_NAME', __( 'ArvanCloud Storage', 'arvancloud-object-storage' ) );
    3232define( 'ACS_SLUG', 'wp-arvancloud-storage');
Note: See TracChangeset for help on using the changeset viewer.