Plugin Directory

Changeset 2009749


Ignore:
Timestamp:
01/10/2019 10:51:40 AM (7 years ago)
Author:
piotrmocko
Message:

Version 1.23.0

Location:
perfectdashboard/trunk
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • perfectdashboard/trunk/Cms/Wordpress/Api.php

    r1908589 r2009749  
    1212            if (defined('DOING_AJAX'))
    1313            {
    14                 add_action('wp_ajax_autoupdater_api', array($this, 'handle'));
    15                 add_action('wp_ajax_nopriv_autoupdater_api', array($this, 'handle'));
     14                add_action('wp_ajax_autoupdater_api', array($this, 'handle'), 10);
     15                add_action('wp_ajax_nopriv_autoupdater_api', array($this, 'handle'), 10);
    1616            }
    1717        }
    1818        else
    1919        {
    20             add_action('init', array($this, 'handle'), 1);
     20            $priority = (isset($_REQUEST['pd_endpoint']) && $_REQUEST['pd_endpoint'] === 'extension/update') ? 10 : 1;
     21            add_action('init', array($this, 'handle'), $priority);
    2122        }
    2223    }
  • perfectdashboard/trunk/Cms/Wordpress/Task/GetExtensions.php

    r1973381 r2009749  
    132132        $pagenow = 'update-core.php';
    133133
     134        // get updates for exceptional extensions (it must be called here)
     135        if (!class_exists(AutoUpdater_Loader::getClassPrefix() . 'Cms_Wordpress_Helper_Extension'))
     136        {
     137            require_once AUTOUPDATER_WP_PLUGIN_PATH . 'Cms/Wordpress/Helper/Extension.php';
     138        }
     139        AutoUpdater_Cms_Wordpress_Helper_Extension::loadMasterSliderPro();
     140
    134141        if (!class_exists(AutoUpdater_Loader::getClassPrefix() . 'Cms_Wordpress_Helper_Tracker'))
    135142        {
     
    149156
    150157        // find updates
     158        // do it two times, so all data will be correctly filled after deleting whole site_transient for update_plugins and update_themes
     159        // looks redundant, but for sure after calling wp_update only once there's no "checked" property in update_plugins and update_themes transients
     160        // and available updates of some plugins are missing in "response" property of these transients
    151161        wp_update_plugins();
     162        wp_update_plugins();
     163        wp_update_themes();
    152164        wp_update_themes();
    153165
  • perfectdashboard/trunk/Cms/Wordpress/Task/PostExtensionUpdate.php

    r1932005 r2009749  
    1010    public function doTask()
    1111    {
    12         $type = $this->input('type');
    13         $slug = $this->input('slug');
     12        $type = strtolower($this->input('type'));
     13        $slug = strtolower($this->input('slug'));
    1414        $path = $this->input('path');
    1515
     
    113113                require_once $upgrader_path . 'Skin/Plugin.php';
    114114
    115                 $data        = get_file_data(WP_PLUGIN_DIR . '/' . $slug, array('Version' => 'Version'));
     115                if (!$path && !get_site_transient('update_plugins')) {
     116                    // do it two times, so all data will be correctly filled
     117                    wp_update_plugins();
     118                    wp_update_plugins();
     119                }
     120
     121                if (!$path && strpos($slug, 'masterslider.php') !== false) {
     122                    // prepare update of exceptional plugins
     123                    if (!class_exists(AutoUpdater_Loader::getClassPrefix() . 'Cms_Wordpress_Helper_Extension'))
     124                    {
     125                        require_once AUTOUPDATER_WP_PLUGIN_PATH . 'Cms/Wordpress/Helper/Extension.php';
     126                    }
     127                    AutoUpdater_Cms_Wordpress_Helper_Extension::loadMasterSliderPro();
     128                }
     129
     130                $plugin_path = WP_PLUGIN_DIR . '/' . $slug;
     131                if (!$filemanager->exists($plugin_path))
     132                {
     133                    $slug = $this->getPluginRealSlug($slug);
     134                    if (!$slug)
     135                    {
     136                        throw AutoUpdater_Exception_Response::getException(
     137                            200, $response['message'],
     138                            'no_update_warning', 'No update was performed, plugin directory not found'
     139                        );
     140                    }
     141                    $plugin_path = WP_PLUGIN_DIR . '/' . $slug;
     142                }
     143
     144                $data        = get_file_data($plugin_path, array('Version' => 'Version'));
    116145                $old_version = $data['Version'];
    117146
     
    138167                        compact('nonce', 'url', 'plugin', 'type')
    139168                    ));
    140                 $result   = $path ? $upgrader->install($path) : $upgrader->upgrade($slug);
    141                 $output   = ob_get_clean();
    142 
    143                 $data        = get_file_data(WP_PLUGIN_DIR . '/' . $slug, array('Version' => 'Version'));
     169                // don't clear update cache, so next plugin's update step in same action will be able to use update cache data
     170                $result = $path ? $upgrader->install($path, array('clear_update_cache' => false)) : $upgrader->upgrade($slug, array('clear_update_cache' => false));
     171                $output = ob_get_clean();
     172
     173                $data        = get_file_data($plugin_path, array('Version' => 'Version'));
    144174                $new_version = $data['Version'];
    145175                break;
     
    151181                require_once $upgrader_path . 'Skin/Theme.php';
    152182
    153                 $data        = get_file_data(WP_CONTENT_DIR . '/themes/' . $slug . '/style.css', array('Version' => 'Version'));
     183                if (!$path && !get_site_transient('update_themes')) {
     184                    // do it two times, so all data will be correctly filled
     185                    wp_update_themes();
     186                    wp_update_themes();
     187                }
     188
     189                $theme_path = WP_CONTENT_DIR . '/themes/' . $slug . '/style.css';
     190                if (!$filemanager->exists($theme_path))
     191                {
     192                    $theme_path = $this->getThemeRealPath($slug);
     193                    if (!$theme_path)
     194                    {
     195                        throw AutoUpdater_Exception_Response::getException(
     196                            200, $response['message'],
     197                            'no_update_warning', 'No update was performed, theme directory not found'
     198                        );
     199                    }
     200                }
     201
     202                $data        = get_file_data($theme_path, array('Version' => 'Version'));
    154203                $old_version = $data['Version'];
    155204
     
    176225                        compact('nonce', 'url', 'theme', 'type')
    177226                    ));
    178                 $result   = $path ? $upgrader->install($path) : $upgrader->upgrade($slug);
    179                 $output   = ob_get_clean();
    180 
    181                 $data        = get_file_data(WP_CONTENT_DIR . '/themes/' . $slug . '/style.css', array('Version' => 'Version'));
     227                // don't clear update cache, so next theme's update step in same action will be able to use update cache data
     228                $result = $path ? $upgrader->install($path, array('clear_update_cache' => false)) : $upgrader->upgrade($slug, array('clear_update_cache' => false));
     229                $output = ob_get_clean();
     230
     231                $data        = get_file_data($theme_path, array('Version' => 'Version'));
    182232                $new_version = $data['Version'];
    183233                break;
     
    200250                            compact('url', 'nonce', 'context')
    201251                        ));
    202                     $result   = $upgrader->bulk_upgrade();
    203                     $output   = ob_get_clean();
     252                    // don't clear update cache, so next extension's update step in same action will be able to use update cache data
     253                    $result = $upgrader->bulk_upgrade(array(), array('clear_update_cache' => false));
     254                    $output = ob_get_clean();
    204255
    205256                    // returns an array of results on success, or true if there are no updates
     
    212263                        $result = new WP_Error('up_to_date', 'There are no translations updates');
    213264                    }
     265
     266                    /** @see AutoUpdater_Cms_Wordpress_Upgrader_Skin_Languagepack::get_translations() */
     267                    $translations = $upgrader->skin->get_translations();
     268                    if (!empty($translations))
     269                    {
     270                        $response['translations'] = $translations;
     271                    }
    214272                }
    215273                else
     
    221279        $filemanager->clearPhpCache();
    222280
     281        /** @see AutoUpdater_Cms_Wordpress_Upgrader_Skin_Core::get_errors() */
    223282        $errors = isset($upgrader) ? $upgrader->skin->get_errors() : array();
    224283        if (is_wp_error($result))
     
    234293            ))
    235294        {
    236             return array(
    237                 'success' => true,
    238                 'message' => $errors['up_to_date'] != 'up_to_date' ? $errors['up_to_date'] : 'Up-to-date'
    239             );
     295            $response['success'] = true;
     296            $response['message'] = $errors['up_to_date'] != 'up_to_date' ? $errors['up_to_date'] : 'Up-to-date';
     297            return $response;
    240298        }
    241299        elseif (array_key_exists('no_package', $errors))
     
    263321        if ($result === true || is_null($result))
    264322        {
    265             return array(
    266                 'success' => true,
    267             );
     323            $response['success'] = true;
     324            unset($response['message']);
     325            return $response;
    268326        }
    269327        elseif (!is_null($result) && !is_bool($result))
     
    300358
    301359        return $response;
     360    }
     361
     362    /**
     363     * @param string $slug
     364     *
     365     * @return string|null
     366     */
     367    protected function getPluginRealSlug($slug)
     368    {
     369        $plugins_dirs = glob(WP_PLUGIN_DIR . '/*');
     370        foreach ($plugins_dirs as $dir)
     371        {
     372            $dir = basename($dir);
     373
     374            // Single file plugin
     375            if (strpos($slug, '/') === false)
     376            {
     377                if (strtolower($dir) === $slug)
     378                {
     379                    return $dir;
     380                }
     381                continue;
     382            }
     383
     384            // Plugin in directory
     385            if (strtolower($dir) === dirname($slug))
     386            {
     387                $plugin_files = glob(WP_PLUGIN_DIR . '/' . $dir . '/*.php');
     388                foreach ($plugin_files as $file)
     389                {
     390                    $slug_file = basename($slug);
     391                    if (strtolower($file) === $slug_file)
     392                    {
     393                        return $dir . '/' . $file;
     394                    }
     395                    continue;
     396                }
     397            }
     398        }
     399
     400        return null;
     401    }
     402
     403    /**
     404     * @param string $slug
     405     *
     406     * @return string|null
     407     */
     408    protected function getThemeRealPath(&$slug)
     409    {
     410        // Theme in directory: wp-themes/slug
     411        $files = glob(WP_CONTENT_DIR . '/themes/*/style.css');
     412        foreach ($files as $file)
     413        {
     414            $slug_based_on_file = basename(dirname($file));
     415            // Is directory before style.css file the same as slug?
     416            if (strtolower($slug_based_on_file) === $slug)
     417            {
     418                $slug = $slug_based_on_file;
     419                return $file;
     420            }
     421        }
     422
     423        // Theme in subdirectory: wp-themes/slug-1.0.0/slug
     424        $files = glob(WP_CONTENT_DIR . '/themes/*/*/style.css');
     425        foreach ($files as $file)
     426        {
     427            $slug_based_on_file = basename(dirname($file));
     428            // Is directory before style.css file the same as slug?
     429            if (strtolower($slug_based_on_file) === $slug)
     430            {
     431                $slug = $slug_based_on_file;
     432                return $file;
     433            }
     434        }
     435
     436        return null;
    302437    }
    303438
  • perfectdashboard/trunk/Cms/Wordpress/Upgrader/Skin/Languagepack.php

    r1908589 r2009749  
    1111
    1212    protected $errors = array();
     13
     14    protected $translations = array();
    1315
    1416    public function header()
     
    6971    }
    7072
     73    /**
     74     * PD: Get a list of updated translations
     75     *
     76     * @return array
     77     */
     78    public function get_translations()
     79    {
     80        return $this->translations;
     81    }
     82
    7183    public function feedback($string)
    7284    {
     
    7991    public function after()
    8092    {
     93        /** @var object $update */
     94        $update = $this->language_update;
     95        $slug   = $update->type == 'core' ? 'wordpress' : $update->slug;
     96
     97        $this->translations[] = sprintf('%s %s %s %s released at %s'
     98            , ucfirst($update->type)
     99            , $slug
     100            , $update->version
     101            , $update->language
     102            , $update->updated
     103        );
    81104    }
    82105
  • perfectdashboard/trunk/app/Admin.php

    r1962848 r2009749  
    239239        $write_token = AutoUpdater_Config::get('write_token');
    240240        $aes_key     = AutoUpdater_Config::get('aes_key');
    241         $expires_at  = AutoUpdater_Config::get('token_expires_at');
    242241        $offline     = AutoUpdater_Config::get('offline', 0);
    243242        $ssl_verify  = AutoUpdater_Config::get('ssl_verify', 0);
  • perfectdashboard/trunk/lib/src/Authentication.php

    r1946575 r2009749  
    4646        }
    4747
    48         if ($method == 'post' && ($token_expires_at = AutoUpdater_Config::get('token_expires_at')))
    49         {
    50             $expires_at = new DateTime($token_expires_at);
    51             $now        = new DateTime();
    52 
    53             $diff_in_seconds = $now->getTimestamp() - $expires_at->getTimestamp();
    54             if ($diff_in_seconds > 0)
    55             {
    56                 AutoUpdater_Log::debug('Write token has expired');
    57                 throw new Exception('Token has expired', 403);
    58             }
    59         }
    60 
    6148        return true;
    6249    }
  • perfectdashboard/trunk/lib/src/Backuptool.php

    r1974720 r2009749  
    3939        {
    4040            return null;
     41        }
     42
     43        if (!is_dir(AUTOUPDATER_ROOT_PATH . $backuptool_dir)
     44            && is_dir(AUTOUPDATER_ROOT_PATH . '../' . $backuptool_dir))
     45        {
     46            // Backup Tool might be one level above the website
     47            return dirname(AUTOUPDATER_ROOT_PATH) . '/' . $backuptool_dir . '/';
    4148        }
    4249
  • perfectdashboard/trunk/lib/src/Exception/Response.php

    r1883279 r2009749  
    2626
    2727    /**
     28     * @param int    $code
     29     * @param string $message
     30     * @param int    $error_code
     31     * @param string $error_message
     32     *
     33     * @return AutoUpdater_Exception_Response
     34     */
     35    public static function getException($code = 0, $message = '', $error_code = 0, $error_message = '')
     36    {
     37        $e = new AutoUpdater_Exception_Response($message, $code);
     38        $e->setError($error_code, $error_message);
     39
     40        return $e;
     41    }
     42
     43    /**
    2844     * @param mixed  $code
    2945     * @param string $message
     46     *
     47     * @return $this
    3048     */
    3149    public function setError($code, $message)
     
    3351        $this->error_code    = $code;
    3452        $this->error_message = $message;
     53
     54        return $this;
    3555    }
    3656
  • perfectdashboard/trunk/lib/src/Response.php

    r1883279 r2009749  
    217217        {
    218218            $this->body = array(
    219                 'data'     => $this->data,
    220                 'metadata' => array(
    221                     'version' => AUTOUPDATER_VERSION,
    222                 )
     219                'data'     => $this->data
     220            );
     221        }
     222
     223        if (is_array($this->body) && !isset($this->body['metadata']))
     224        {
     225            $this->body['metadata'] = array(
     226                'version' => AUTOUPDATER_VERSION
    223227            );
    224228        }
  • perfectdashboard/trunk/lib/src/vendor/composer/installed.json

    r1946575 r2009749  
    5252    {
    5353        "name": "paragonie/sodium_compat",
    54         "version": "v1.7.0",
    55         "version_normalized": "1.7.0.0",
     54        "version": "v1.8.1",
     55        "version_normalized": "1.8.1.0",
    5656        "source": {
    5757            "type": "git",
    5858            "url": "https://github.com/paragonie/sodium_compat.git",
    59             "reference": "7b73005be3c224f12c47bd75a23ce24b762e47e8"
     59            "reference": "57bb5ef079d3724148da3d5c99e30695ab17afda"
    6060        },
    6161        "dist": {
    6262            "type": "zip",
    63             "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/7b73005be3c224f12c47bd75a23ce24b762e47e8",
    64             "reference": "7b73005be3c224f12c47bd75a23ce24b762e47e8",
     63            "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/57bb5ef079d3724148da3d5c99e30695ab17afda",
     64            "reference": "57bb5ef079d3724148da3d5c99e30695ab17afda",
    6565            "shasum": ""
    6666        },
     
    7676            "ext-sodium": "PHP >= 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security."
    7777        },
    78         "time": "2018-09-22T03:59:58+00:00",
     78        "time": "2019-01-03T21:00:55+00:00",
    7979        "type": "library",
    8080        "installation-source": "dist",
  • perfectdashboard/trunk/lib/src/vendor/paragonie/sodium_compat/README.md

    r1946575 r2009749  
    2929such as [Joomla!](https://github.com/joomla/joomla-cms/blob/459d74686d2a638ec51149d7c44ddab8075852be/composer.json#L40)
    3030and [Magento](https://github.com/magento/magento2/blob/8fd89cfdf52c561ac0ca7bc20fd38ef688e201b0/composer.json#L44).
     31Furthermore, sodium_compat was developed by Paragon Initiative Enterprises, a
     32company that *specializes* in secure PHP development and PHP cryptography, and
     33has been informally reviewed by many other security experts who also specialize
     34in PHP.
    3135
    3236If you'd like to learn more about the defensive security measures we've taken
     
    9397software for free, but will strive to fix any bugs (security-related or otherwise) in our library.
    9498
     99## Support Contracts
     100
     101If your company uses this library in their products or services, you may be
     102interested in [purchasing a support contract from Paragon Initiative Enterprises](https://paragonie.com/enterprise).
     103
    95104# Using Sodium Compat
    96105
     
    193202      without harming the security of your cryptography keys. If your processor *isn't* safe, then decide whether you
    194203      want speed or security because you can't have both.
     204
     205### How can I tell if sodium_compat will be slow, at runtime?
     206
     207Since version 1.8, you can use the `polyfill_is_fast()` static method to
     208determine if sodium_compat will be slow at runtime.
     209
     210```php
     211<?php
     212if (ParagonIE_Sodium_Compat::polyfill_is_fast()) {
     213    // Use libsodium now
     214    $process->execute();
     215} else {
     216    // Defer to a cron job or other sort of asynchronous process
     217    $process->enqueue();
     218}
     219```
    195220
    196221### Help, my PHP only has 32-Bit Integers! It's super slow!
  • perfectdashboard/trunk/lib/src/vendor/paragonie/sodium_compat/appveyor.yml

    r1853488 r2009749  
    55  - x64
    66clone_folder: C:\projects\sodium_compat
     7image: Visual Studio 2017
    78
    89install:
  • perfectdashboard/trunk/lib/src/vendor/paragonie/sodium_compat/lib/php72compat.php

    r1853488 r2009749  
    6464    'CRYPTO_STREAM_KEYBYTES',
    6565    'CRYPTO_STREAM_NONCEBYTES',
     66    'LIBRARY_VERSION_MAJOR',
     67    'LIBRARY_VERSION_MINOR',
     68    'VERSION_STRING'
    6669    ) as $constant
    6770) {
     
    427430     * @param string $kp
    428431     * @return string|bool
     432     * @throws SodiumException
    429433     */
    430434    function sodium_crypto_box_seal_open($message, $kp)
     
    432436        try {
    433437            return ParagonIE_Sodium_Compat::crypto_box_seal_open($message, $kp);
    434         } catch (Error $ex) {
    435             return false;
    436         } catch (Exception $ex) {
     438        } catch (SodiumException $ex) {
     439            if ($ex->getMessage() === 'Argument 2 must be CRYPTO_BOX_KEYPAIRBYTES long.') {
     440                throw $ex;
     441            }
    437442            return false;
    438443        }
  • perfectdashboard/trunk/lib/src/vendor/paragonie/sodium_compat/src/Compat.php

    r1946575 r2009749  
    26412641
    26422642    /**
     2643     * Will sodium_compat run fast on the current hardware and PHP configuration?
     2644     *
     2645     * @return bool
     2646     */
     2647    public static function polyfill_is_fast()
     2648    {
     2649        if (extension_loaded('sodium')) {
     2650            return true;
     2651        }
     2652        if (extension_loaded('libsodium')) {
     2653            return true;
     2654        }
     2655        return PHP_INT_SIZE === 8;
     2656    }
     2657
     2658    /**
    26432659     * Generate a string of bytes from the kernel's CSPRNG.
    26442660     * Proudly uses /dev/urandom (if getrandom(2) is not available).
  • perfectdashboard/trunk/lib/src/vendor/paragonie/sodium_compat/src/Core32/Curve25519.php

    r1946575 r2009749  
    508508        /** @var ParagonIE_Sodium_Core32_Int64 $f9_2 */
    509509        $f9_2 = $f9->shiftLeft(1);
    510         $f0g0    = $f0->mulInt64($g0, 30);
    511         $f0g1    = $f0->mulInt64($g1, 29);
    512         $f0g2    = $f0->mulInt64($g2, 30);
    513         $f0g3    = $f0->mulInt64($g3, 29);
    514         $f0g4    = $f0->mulInt64($g4, 30);
    515         $f0g5    = $f0->mulInt64($g5, 29);
    516         $f0g6    = $f0->mulInt64($g6, 30);
    517         $f0g7    = $f0->mulInt64($g7, 29);
    518         $f0g8    = $f0->mulInt64($g8, 30);
    519         $f0g9    = $f0->mulInt64($g9, 30);
    520         $f1g0    = $f1->mulInt64($g0, 30);
    521         $f1g1_2  = $f1_2->mulInt64($g1, 30);
    522         $f1g2    = $f1->mulInt64($g2, 30);
    523         $f1g3_2  = $f1_2->mulInt64($g3, 30);
     510        $f0g0    = $f0->mulInt64($g0, 27);
     511        $f0g1    = $f0->mulInt64($g1, 27);
     512        $f0g2    = $f0->mulInt64($g2, 27);
     513        $f0g3    = $f0->mulInt64($g3, 27);
     514        $f0g4    = $f0->mulInt64($g4, 27);
     515        $f0g5    = $f0->mulInt64($g5, 27);
     516        $f0g6    = $f0->mulInt64($g6, 27);
     517        $f0g7    = $f0->mulInt64($g7, 27);
     518        $f0g8    = $f0->mulInt64($g8, 27);
     519        $f0g9    = $f0->mulInt64($g9, 27);
     520        $f1g0    = $f1->mulInt64($g0, 27);
     521        $f1g1_2  = $f1_2->mulInt64($g1, 27);
     522        $f1g2    = $f1->mulInt64($g2, 27);
     523        $f1g3_2  = $f1_2->mulInt64($g3, 27);
    524524        $f1g4    = $f1->mulInt64($g4, 30);
    525525        $f1g5_2  = $f1_2->mulInt64($g5, 30);
     
    812812        $f9_38 = $f9->mulInt(38, 6);
    813813        /** @var ParagonIE_Sodium_Core32_Int64 $f0f0*/
    814         $f0f0    = $f0->mulInt64($f0, 29);
    815         $f0f1_2  = $f0_2->mulInt64($f1, 29);
    816         $f0f2_2 =  $f0_2->mulInt64($f2, 29);
    817         $f0f3_2 =  $f0_2->mulInt64($f3, 29);
    818         $f0f4_2 =  $f0_2->mulInt64($f4, 29);
    819         $f0f5_2 =  $f0_2->mulInt64($f5, 29);
    820         $f0f6_2 =  $f0_2->mulInt64($f6, 29);
    821         $f0f7_2 =  $f0_2->mulInt64($f7, 29);
    822         $f0f8_2 =  $f0_2->mulInt64($f8, 29);
    823         $f0f9_2 =  $f0_2->mulInt64($f9, 29);
    824 
    825         $f1f1_2 = $f1_2->mulInt64($f1, 29);
    826         $f1f2_2 = $f1_2->mulInt64($f2, 29);
    827         $f1f3_4 = $f1_2->mulInt64($f3_2, 29);
    828         $f1f4_2 = $f1_2->mulInt64($f4, 29);
     814        $f0f0    = $f0->mulInt64($f0, 28);
     815        $f0f1_2  = $f0_2->mulInt64($f1, 28);
     816        $f0f2_2 =  $f0_2->mulInt64($f2, 28);
     817        $f0f3_2 =  $f0_2->mulInt64($f3, 28);
     818        $f0f4_2 =  $f0_2->mulInt64($f4, 28);
     819        $f0f5_2 =  $f0_2->mulInt64($f5, 28);
     820        $f0f6_2 =  $f0_2->mulInt64($f6, 28);
     821        $f0f7_2 =  $f0_2->mulInt64($f7, 28);
     822        $f0f8_2 =  $f0_2->mulInt64($f8, 28);
     823        $f0f9_2 =  $f0_2->mulInt64($f9, 28);
     824
     825        $f1f1_2 = $f1_2->mulInt64($f1, 28);
     826        $f1f2_2 = $f1_2->mulInt64($f2, 28);
     827        $f1f3_4 = $f1_2->mulInt64($f3_2, 28);
     828        $f1f4_2 = $f1_2->mulInt64($f4, 28);
    829829        $f1f5_4 = $f1_2->mulInt64($f5_2, 30);
    830         $f1f6_2 = $f1_2->mulInt64($f6, 29);
    831         $f1f7_4 = $f1_2->mulInt64($f7_2, 29);
    832         $f1f8_2 = $f1_2->mulInt64($f8, 29);
     830        $f1f6_2 = $f1_2->mulInt64($f6, 28);
     831        $f1f7_4 = $f1_2->mulInt64($f7_2, 28);
     832        $f1f8_2 = $f1_2->mulInt64($f8, 28);
    833833        $f1f9_76 = $f9_38->mulInt64($f1_2, 30);
    834834
    835         $f2f2 = $f2->mulInt64($f2, 29);
    836         $f2f3_2 = $f2_2->mulInt64($f3, 29);
    837         $f2f4_2 = $f2_2->mulInt64($f4, 29);
    838         $f2f5_2 = $f2_2->mulInt64($f5, 29);
    839         $f2f6_2 = $f2_2->mulInt64($f6, 29);
    840         $f2f7_2 = $f2_2->mulInt64($f7, 29);
     835        $f2f2 = $f2->mulInt64($f2, 28);
     836        $f2f3_2 = $f2_2->mulInt64($f3, 28);
     837        $f2f4_2 = $f2_2->mulInt64($f4, 28);
     838        $f2f5_2 = $f2_2->mulInt64($f5, 28);
     839        $f2f6_2 = $f2_2->mulInt64($f6, 28);
     840        $f2f7_2 = $f2_2->mulInt64($f7, 28);
    841841        $f2f8_38 = $f8_19->mulInt64($f2_2, 30);
    842842        $f2f9_38 = $f9_38->mulInt64($f2, 30);
    843843
    844         $f3f3_2 = $f3_2->mulInt64($f3, 29);
    845         $f3f4_2 = $f3_2->mulInt64($f4, 29);
     844        $f3f3_2 = $f3_2->mulInt64($f3, 28);
     845        $f3f4_2 = $f3_2->mulInt64($f4, 28);
    846846        $f3f5_4 = $f3_2->mulInt64($f5_2, 30);
    847         $f3f6_2 = $f3_2->mulInt64($f6, 29);
     847        $f3f6_2 = $f3_2->mulInt64($f6, 28);
    848848        $f3f7_76 = $f7_38->mulInt64($f3_2, 30);
    849849        $f3f8_38 = $f8_19->mulInt64($f3_2, 30);
    850850        $f3f9_76 = $f9_38->mulInt64($f3_2, 30);
    851851
    852         $f4f4 = $f4->mulInt64($f4, 29);
    853         $f4f5_2 = $f4_2->mulInt64($f5, 29);
     852        $f4f4 = $f4->mulInt64($f4, 28);
     853        $f4f5_2 = $f4_2->mulInt64($f5, 28);
    854854        $f4f6_38 = $f6_19->mulInt64($f4_2, 30);
    855855        $f4f7_38 = $f7_38->mulInt64($f4, 30);
     
    868868        $f6f9_38 = $f9_38->mulInt64($f6, 30);
    869869
    870         $f7f7_38 = $f7_38->mulInt64($f7, 29);
     870        $f7f7_38 = $f7_38->mulInt64($f7, 28);
    871871        $f7f8_38 = $f8_19->mulInt64($f7_2, 30);
    872872        $f7f9_76 = $f9_38->mulInt64($f7_2, 30);
     
    875875        $f8f9_38 = $f9_38->mulInt64($f8, 30);
    876876
    877         $f9f9_38 = $f9_38->mulInt64($f9, 29);
     877        $f9f9_38 = $f9_38->mulInt64($f9, 28);
    878878
    879879        $h0 = $f0f0->addInt64($f1f9_76)->addInt64($f2f8_38)->addInt64($f3f7_76)->addInt64($f4f6_38)->addInt64($f5f5_38);
     
    10321032        $f1f7_4 = $f1_2->mulInt64($f7_2, 29);
    10331033        $f1f8_2 = $f1_2->mulInt64($f8, 28);
    1034         $f1f9_76 = $f9_38->mulInt64($f1_2, 30);
     1034        $f1f9_76 = $f9_38->mulInt64($f1_2, 29);
    10351035        $f2f2 = $f2->mulInt64($f2, 28);
    10361036        $f2f3_2 = $f2_2->mulInt64($f3, 28);
     
    10391039        $f2f6_2 = $f2_2->mulInt64($f6, 28);
    10401040        $f2f7_2 = $f2_2->mulInt64($f7, 28);
    1041         $f2f8_38 = $f8_19->mulInt64($f2_2, 30);
    1042         $f2f9_38 = $f9_38->mulInt64($f2, 30);
     1041        $f2f8_38 = $f8_19->mulInt64($f2_2, 29);
     1042        $f2f9_38 = $f9_38->mulInt64($f2, 29);
    10431043        $f3f3_2 = $f3_2->mulInt64($f3, 28);
    10441044        $f3f4_2 = $f3_2->mulInt64($f4, 28);
    10451045        $f3f5_4 = $f3_2->mulInt64($f5_2, 28);
    10461046        $f3f6_2 = $f3_2->mulInt64($f6, 28);
    1047         $f3f7_76 = $f7_38->mulInt64($f3_2, 30);
    1048         $f3f8_38 = $f8_19->mulInt64($f3_2, 30);
    1049         $f3f9_76 = $f9_38->mulInt64($f3_2, 30);
     1047        $f3f7_76 = $f7_38->mulInt64($f3_2, 29);
     1048        $f3f8_38 = $f8_19->mulInt64($f3_2, 29);
     1049        $f3f9_76 = $f9_38->mulInt64($f3_2, 29);
    10501050        $f4f4 = $f4->mulInt64($f4, 28);
    10511051        $f4f5_2 = $f4_2->mulInt64($f5, 28);
    1052         $f4f6_38 = $f6_19->mulInt64($f4_2, 30);
    1053         $f4f7_38 = $f7_38->mulInt64($f4, 30);
    1054         $f4f8_38 = $f8_19->mulInt64($f4_2, 30);
    1055         $f4f9_38 = $f9_38->mulInt64($f4, 30);
    1056         $f5f5_38 = $f5_38->mulInt64($f5, 30);
    1057         $f5f6_38 = $f6_19->mulInt64($f5_2, 30);
    1058         $f5f7_76 = $f7_38->mulInt64($f5_2, 30);
    1059         $f5f8_38 = $f8_19->mulInt64($f5_2, 30);
    1060         $f5f9_76 = $f9_38->mulInt64($f5_2, 30);
    1061         $f6f6_19 = $f6_19->mulInt64($f6, 30);
    1062         $f6f7_38 = $f7_38->mulInt64($f6, 30);
    1063         $f6f8_38 = $f8_19->mulInt64($f6_2, 30);
    1064         $f6f9_38 = $f9_38->mulInt64($f6, 30);
    1065         $f7f7_38 = $f7_38->mulInt64($f7, 30);
    1066         $f7f8_38 = $f8_19->mulInt64($f7_2, 30);
    1067         $f7f9_76 = $f9_38->mulInt64($f7_2, 30);
    1068         $f8f8_19 = $f8_19->mulInt64($f8, 30);
    1069         $f8f9_38 = $f9_38->mulInt64($f8, 30);
    1070         $f9f9_38 = $f9_38->mulInt64($f9, 30);
     1052        $f4f6_38 = $f6_19->mulInt64($f4_2, 29);
     1053        $f4f7_38 = $f7_38->mulInt64($f4, 29);
     1054        $f4f8_38 = $f8_19->mulInt64($f4_2, 29);
     1055        $f4f9_38 = $f9_38->mulInt64($f4, 29);
     1056        $f5f5_38 = $f5_38->mulInt64($f5, 29);
     1057        $f5f6_38 = $f6_19->mulInt64($f5_2, 29);
     1058        $f5f7_76 = $f7_38->mulInt64($f5_2, 29);
     1059        $f5f8_38 = $f8_19->mulInt64($f5_2, 29);
     1060        $f5f9_76 = $f9_38->mulInt64($f5_2, 29);
     1061        $f6f6_19 = $f6_19->mulInt64($f6, 29);
     1062        $f6f7_38 = $f7_38->mulInt64($f6, 29);
     1063        $f6f8_38 = $f8_19->mulInt64($f6_2, 29);
     1064        $f6f9_38 = $f9_38->mulInt64($f6, 29);
     1065        $f7f7_38 = $f7_38->mulInt64($f7, 29);
     1066        $f7f8_38 = $f8_19->mulInt64($f7_2, 29);
     1067        $f7f9_76 = $f9_38->mulInt64($f7_2, 29);
     1068        $f8f8_19 = $f8_19->mulInt64($f8, 29);
     1069        $f8f9_38 = $f9_38->mulInt64($f8, 29);
     1070        $f9f9_38 = $f9_38->mulInt64($f9, 29);
    10711071
    10721072        $h0 = $f0f0->addInt64($f1f9_76)->addInt64($f2f8_38)->addInt64($f3f7_76)->addInt64($f4f6_38)->addInt64($f5f5_38);
  • perfectdashboard/trunk/perfectdashboard.php

    r1974720 r2009749  
    44 * Plugin URI: https://perfectdashboard.com/?utm_source=backend&utm_medium=installer&utm_campaign=in&utm_term=WP
    55 * Description:
    6  * Version: 1.20.2
     6 * Version: 1.23.0
    77 * Text Domain: autoupdater
    88 * Author: Perfect Dashboard
     
    4848    function AutoUpdater_getRootPath()
    4949    {
    50         if (isset($_SERVER['SCRIPT_FILENAME']))
     50        if (!empty($_SERVER['SCRIPT_FILENAME']))
    5151        {
    52             $path = dirname($_SERVER['SCRIPT_FILENAME']) . '/';
    53             if (basename($path) == 'wp-admin')
     52            $path = dirname(realpath($_SERVER['SCRIPT_FILENAME'])) . '/';
     53            if (defined('CMSDETECTOR'))
    5454            {
    55                 $path = dirname($path) . '/';
     55                // Core files in subdirectory
     56                if (!file_exists($path . 'index.php') && file_exists($path . '../index.php'))
     57                {
     58                    return dirname($path) . '/';
     59                }
    5660            }
     61            elseif (basename($path) == 'wp-admin')
     62            {
     63                return dirname($path) . '/';
     64            }
     65
    5766            return $path;
    5867        }
     
    6170        if (isset($files[0]) && substr($files[0], -9) == 'index.php')
    6271        {
    63             return dirname($files[0]) . '/';
     72            return dirname(realpath($files[0])) . '/';
    6473        }
    6574
  • perfectdashboard/trunk/readme.txt

    r1990594 r2009749  
    44Tags: manage multiple sites, manage wordpress, backup, security, malware
    55Requires at least: 3.0
    6 Tested up to: 5.0
    7 Stable tag: 1.20.2
     6Tested up to: 5.0.3
     7Stable tag: 1.23.0
    88License: GNU/GPL
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
  • perfectdashboard/trunk/tmpl/configuration_form_advanced_fields.tmpl.php

    r1962848 r2009749  
    99        <td>
    1010            <input id="autoupdater_read_token" name="read_token" type="text" class="regular-text"
    11                    value="<?php echo $read_token; ?>"<?php if ($protect || $expires_at) echo ' disabled="disabled"'; ?>
     11                   value="<?php echo $read_token; ?>"<?php if ($protect) echo ' disabled="disabled"'; ?>
    1212            />
    1313            <p class="description">
     
    2424        <td>
    2525            <input id="autoupdater_write_token" name="write_token" type="text" class="regular-text"
    26                    value="<?php echo $write_token; ?>"<?php if ($protect || $expires_at) echo ' disabled="disabled"'; ?>
     26                   value="<?php echo $write_token; ?>"<?php if ($protect) echo ' disabled="disabled"'; ?>
    2727            />
    28             <?php if ($expires_at) echo '<p>' . sprintf(__('Expires at %s', 'autoupdater'), $expires_at) . '</p>'; ?>
    2928            <p class="description">
    3029                <?php _e('This token is used during making modifications to the website', 'autoupdater') ?>
Note: See TracChangeset for help on using the changeset viewer.