WordPress.org

Plugin Directory

Changeset 1559143


Ignore:
Timestamp:
12/21/16 16:44:28 (9 months ago)
Author:
freediver
Message:
  • worker 4.2.15
Location:
worker/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • worker/trunk/init.php

    r1555692 r1559143  
    44Plugin URI: https://managewp.com 
    55Description: ManageWP Worker plugin allows you to manage your WordPress sites from one dashboard. Visit <a href="https://managewp.com">ManageWP.com</a> for more information. 
    6 Version: 4.2.14 
     6Version: 4.2.15 
    77Author: ManageWP 
    88Author URI: https://managewp.com 
     
    564564        register_activation_hook(__FILE__, 'mwp_activation_hook'); 
    565565 
    566         $GLOBALS['MMB_WORKER_VERSION']  = '4.2.14'; 
    567         $GLOBALS['MMB_WORKER_REVISION'] = '2016-12-15 00:00:00'; 
     566        $GLOBALS['MMB_WORKER_VERSION']  = '4.2.15'; 
     567        $GLOBALS['MMB_WORKER_REVISION'] = '2016-12-21 00:00:00'; 
    568568 
    569569        // Ensure PHP version compatibility. 
  • worker/trunk/readme.txt

    r1555692 r1559143  
    5959 
    6060== Changelog == 
     61 
     62= 4.2.15 = 
     63 
     64- Fix: Core updates not showing correctly in some cases. 
     65- Fix: Better memory limit handling. 
     66- Fix: SpamShield plugin compatibility. 
    6167 
    6268= 4.2.14 = 
  • worker/trunk/src/MMB/Stats.php

    r1555692 r1559143  
    7373                    $current_transient = $core->updates[0]; 
    7474                } 
    75                 if ($current_transient->response == "development" || version_compare($wp_version, $current_transient->current, '<') || $locale !== $current_transient->locale) { 
     75                // WordPress can actually have an update to the same version and locale if locale has not been updated 
     76                if ($current_transient->response == 'development' || $current_transient->response == 'upgrade' || version_compare($wp_version, $current_transient->current, '<') || $locale !== $current_transient->locale) { 
    7677                    $current_transient->current_version = $wp_version; 
    7778                    $stats['core_updates']              = $current_transient; 
  • worker/trunk/src/MWP/Event/Events.php

    r1070446 r1559143  
    1212{ 
    1313    /** 
    14      * Fired if the master response is detected. 
     14     * Fired if a master request is detected. 
    1515     * 
    1616     * @see MWP_Event_MasterRequest 
     
    1919 
    2020    /** 
    21      * Fired if non-master response is detected. 
     21     * Fired if a non-master request is detected. 
    2222     * 
    2323     * @see MWP_Event_PublicRequest 
  • worker/trunk/src/MWP/EventListener/ActionRequest/SetSettings.php

    r1195347 r1559143  
    3737        // Prevent PHP Warning: set_time_limit() has been disabled for security reasons in __FILE__ 
    3838        @set_time_limit(1800); 
    39         $this->setMemoryLimit(); 
    4039        $this->resetVersions(); 
    4140        $this->migration->migrate(); 
     
    7170    } 
    7271 
    73     /** 
    74      * By default, WordPress sets limits of 40MB for regular installations and 64MB for multi-sites. 
    75      * If the limit is lower, try to increase it a bit here. 
    76      */ 
    77     private function setMemoryLimit() 
    78     { 
    79         $wantedLimit = 64 * 1024 * 1024; 
    80         $memoryLimit = $this->system->getMemoryLimit(); 
    81  
    82         if ($memoryLimit !== -1 && $memoryLimit < $wantedLimit) { 
    83             ini_set('memory_limit', $wantedLimit); 
    84         } 
    85     } 
    86  
    8772    private function saveWorkerConfiguration(array $data) 
    8873    { 
  • worker/trunk/src/MWP/EventListener/FixCompatibility.php

    r1555692 r1559143  
    3030                array('fixSidekickPlugin', -10000), 
    3131                array('fixSpamShield', -10000), 
     32                array('fixWpSpamShieldBan', -10000), 
    3233            ), 
    3334        ); 
     35    } 
     36 
     37    public function fixWpSpamShieldBan() 
     38    { 
     39        $wpss_ubl_cache = $this->context->optionGet('spamshield_ubl_cache'); 
     40 
     41        if (empty($wpss_ubl_cache)){ 
     42            return; 
     43        } 
     44 
     45        $serverIp = !empty($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : null; 
     46 
     47        foreach ($wpss_ubl_cache as $key => $singleIp) { 
     48            if ($singleIp !== $serverIp) { 
     49                continue; 
     50            } 
     51 
     52            unset($wpss_ubl_cache[$key]); 
     53        } 
     54 
     55        $this->context->optionSet('spamshield_ubl_cache', array_values($wpss_ubl_cache)); 
    3456    } 
    3557 
  • worker/trunk/src/MWP/EventListener/MasterRequest/SetRequestSettings.php

    r1555692 r1559143  
    3232        } 
    3333 
    34         // WP_MAX_MEMORY_LIMIT 
    35         @ini_set('memory_limit', '256M'); 
     34        MWP_System_Utils::setMemoryLimit(MWP_System_Utils::getWPMaxMemoryLimit()); 
    3635 
    3736        $data = $event->getRequest()->getData(); 
     
    8483        $context = $this->context; 
    8584 
    86         $memoryLimit = MWP_System_Utils::convertToBytes(ini_get('memory_limit')); 
    87         if ($memoryLimit !== -1 && $memoryLimit < 268435456) { 
    88             // WP_MAX_MEMORY_LIMIT 
    89             @ini_set('memory_limit', '256M'); 
    90         } 
     85        MWP_System_Utils::setMemoryLimit(MWP_System_Utils::getWPMaxMemoryLimit()); 
    9186        $this->context->addFilter('http_response', array($this, 'captureCacheUpdateCall'), MAX_PRIORITY_HOOK, 3); 
    9287        $this->context->addFilter('pre_http_request', array($this, 'interceptCacheUpdateCall'), MAX_PRIORITY_HOOK, 3); 
     
    109104        set_current_screen(); 
    110105        $context->doAction('load-update-core.php'); 
     106 
    111107        /** @handled function */ 
    112         wp_version_check(array(), false); 
     108        wp_version_check(); 
     109 
     110        /** @handled function */ 
     111        wp_version_check(array(), true); 
    113112    } 
    114113 
  • worker/trunk/src/MWP/System/Environment.php

    r1260951 r1559143  
    2020    { 
    2121        $this->container = $container; 
    22     } 
    23  
    24     public function getMemoryLimit() 
    25     { 
    26         return MWP_System_Utils::convertToBytes(ini_get('memory_limit')); 
    2722    } 
    2823 
  • worker/trunk/src/MWP/System/Utils.php

    r1173621 r1559143  
    2020    public static function convertToBytes($memoryLimit) 
    2121    { 
    22         $memoryLimit = (string) $memoryLimit; 
     22        $memoryLimit = (string)$memoryLimit; 
    2323 
    2424        if ('-1' === $memoryLimit) { 
     
    5252        return $max; 
    5353    } 
     54 
     55    public static function getCurrentMemoryLimit() 
     56    { 
     57        return MWP_System_Utils::convertToBytes(ini_get('memory_limit')); 
     58    } 
     59 
     60    public static function getWPMemoryLimit() 
     61    { 
     62        if (!defined('WP_MEMORY_LIMIT')) { 
     63            return '64M'; 
     64        } 
     65 
     66        return WP_MEMORY_LIMIT; 
     67    } 
     68 
     69    public static function getWPMaxMemoryLimit() 
     70    { 
     71        if (!defined('WP_MAX_MEMORY_LIMIT')) { 
     72            return '256M'; 
     73        } 
     74 
     75        return WP_MAX_MEMORY_LIMIT; 
     76    } 
     77 
     78    public static function setMemoryLimit($tryLimit) 
     79    { 
     80        $limitValue   = self::convertToBytes($tryLimit); 
     81        $currentValue = self::getCurrentMemoryLimit(); 
     82 
     83        if ($currentValue === -1 || $currentValue >= $limitValue) { 
     84            return; 
     85        } 
     86 
     87        @ini_set('memory_limit', $tryLimit); 
     88    } 
    5489} 
  • worker/trunk/version

    r1555692 r1559143  
    1 4.2.14 
    2 2016-12-15 00:00:00 
     14.2.15 
     22016-12-21 00:00:00 
Note: See TracChangeset for help on using the changeset viewer.