Plugin Directory

Changeset 2324087


Ignore:
Timestamp:
06/15/2020 01:59:08 AM (6 years ago)
Author:
latcomsystems
Message:

Version 1.9

Location:
lcs-security/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lcs-security/trunk/lcs-security.php

    r2324069 r2324087  
    44Plugin URI: http://www.latcomsystems.com/index.cfm?SheetIndex=wp_lcs_security
    55Description: Adds a comprehensive suite of security measures to WordPress.
    6 Version: 1.8
     6Version: 1.9
    77Author: LatCom Systems
    88Author URI: http://www.latcomsystems.com/
     
    4848            register_activation_hook(__FILE__, array($this, 'lcs_sec_activation'));
    4949            register_deactivation_hook(__FILE__, array($this, 'lcs_sec_deactivation'));
     50            $this->check_for_updates();
    5051            $this->lcs_sec_run();
    5152            //add_action('init', array($this, 'lcs_sec_run'));
     
    126127        }
    127128
     129        private function check_for_updates() {
     130            if (is_admin()) :
     131                $metadata = get_file_data(__FILE__, ['Version' => 'Version'], false);
     132                $plugin_version = $metadata['Version'];
     133                if (get_option($this->settings_prefix.'version') != $plugin_version) :
     134                    add_action('admin_menu', array($this, 'lcs_sec_activation'));
     135                    update_option($this->settings_prefix.'version', $plugin_version);
     136                endif;
     137            endif;
     138        }
     139
    128140        public function lcs_sec_menu()
    129141        {
     
    439451                    $path = $path_obj['basedir'];
    440452                    $web_config_file = $path.'/web.config';
    441                     if ( ( ( ! file_exists($web_config_file) && win_is_writable($home_path) ) || win_is_writable($web_config_file) ) ) :
     453                    if ( ( ( ! file_exists($web_config_file) && win_is_writable($path) ) || win_is_writable($web_config_file) ) ) :
    442454                        if ($value == 1) :
    443455                            return (file_put_contents($web_config_file, file_get_contents(__DIR__.'/template_web_config.txt', false)) !== false);
     
    468480                if ($is_iis7) :
    469481                    $path = get_home_path();
    470                     $web_config_file = $path.'/wp-includes/web.config';
    471                     if ( ( ( ! file_exists($web_config_file) && win_is_writable($home_path) ) || win_is_writable($web_config_file) ) ) :
     482                    $web_config_file = $path.'wp-includes/web.config';
     483                    if ( ( ( ! file_exists($web_config_file) && win_is_writable($path) ) || win_is_writable($web_config_file) ) ) :
    472484                        if ($value == 1) :
    473485                            return (file_put_contents($web_config_file, file_get_contents(__DIR__.'/template_web_config_includes.txt', false)) !== false);
     
    482494                elseif ($is_apache) :
    483495                    $path = get_home_path();
    484                     $htaccess_file = $path.'/wp-includes/.htaccess';
     496                    $htaccess_file = $path.'wp-includes/.htaccess';
    485497                    if ((!file_exists($htaccess_file) && is_writable($path)) || is_writable($htaccess_file)) :
    486498                        if ($value == 1) :
     
    584596        }
    585597
    586         public function disable_code_editing() {
     598        private function disable_code_editing() {
    587599            define('DISALLOW_FILE_EDIT', true);
    588600        }
  • lcs-security/trunk/readme.txt

    r2324069 r2324087  
    55Requires at least: 3.5
    66Tested up to: 5.4
    7 Stable tag: 1.8
     7Stable tag: 1.9
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/agpl-2.0.html
     
    7979== Changelog ==
    8080
     81= 1.9 =
     82* Set newly added default options during update.
     83* Minor bug fix.
     84
    8185= 1.8 =
    8286* Add option to disable code editing within wp-admin.
Note: See TracChangeset for help on using the changeset viewer.